Re: mythtv v34 installation if user 'mythtv' is already crea…

Page principale

Répondre à ce message
Auteur: Lennart Sorensen
Date:  
À: dmo-discussion
Sujet: Re: mythtv v34 installation if user 'mythtv' is already created?
On Fri, Mar 01, 2024 at 05:08:21PM +0100, Christian Marillat wrote:
> We already check HOME in mythtv-backend.postinst and
> mythtv-common.postinst with this command:
>
> getent passwd mythtv | awk -F: '{ print $6}'
>
> But I don't know how to do that in the service file.
>
> Any ideas ?


I found this seems to work after a bit of trying things:

[Unit]
Description=MythTV Test
After=mysql.service network.target

[Service]
User=mythtv
EnvironmentFile=-/etc/default/mythtv-backend
ExecStart=echo $HOME
StartLimitBurst=10
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target

So it seems just don't set HOME environment, it is already done correctly
for the User=mythtv part. Maybe it wasn't always that way in the past.

I got this output:

Mar 01 11:44:42 mythtv64 systemd[1]: Started mythtv-test.service - MythTV Test.
Mar 01 11:44:42 mythtv64 echo[3332855]: /var/lib/mythtv
Mar 01 11:44:42 mythtv64 systemd[1]: mythtv-test.service: Deactivated successfully.

--
Len Sorensen