[mythtv-users] Starting mythfrontend with systemd?

Bill Meek keemllib at gmail.com
Thu Oct 5 23:54:10 UTC 2017


On 10/05/2017 05:29 PM, Ian Evans wrote:
> On Thu, Oct 5, 2017 at 4:43 PM, Richard Shaw <hobbes1069 at gmail.com> wrote:

...

>> I'm not sure if the service even fired off but I think you still want to
>> keep "After=graphical-session.target" as well...
>>
>> As far as checking I would try:
>>
>> systemctl status mythtv@:0.service
>>
>> Thanks,
>> Richard
>>
>>
>>
>>
> Okay for completeness, this is the current frontend service file after your
> suggestion:
> 
>          [Unit]
>          Description=the open source DVR, MythTV
>          After=mysql.service graphical-session.target
>          BindsTo=graphical-session.target
> 
>          [Service]
>          Environment=DISPLAY=%i
>          ExecStart=/usr/bin/mythfrontend
> 
>          [Install]
>          WantedBy=graphical-session.target
> 
> 
> Frontend still did not start after boot.
> 
> ian at buster:~$ systemctl status mythtv@:0.service
> â mythtv@:0.service - the open source DVR, MythTV
>     Loaded: loaded (/etc/systemd/system/mythtv at .service; enabled; vendor
> preset: enabled)
>     Active: inactive (dead)

1 minute 55 seconds after login my frontend started:

bill at ofc0:/etc/systemd/system$ cat mythtv-frontend@\:0.service
[Unit]
Description=MythTV Frontend
After=mythtv-backend.service
BindsTo=graphical.target

[Service]
User=bill
Environment=DISPLAY=%i
ExecStart=/usr/local/bin/mythfrontend

[Install]
WantedBy=graphical.target

Ignore the service name, just my choice. mythfrontend must access a
valid config.xml (if User isn't specified, then /root/.mythtv/config.xml
would be used.

Also, I added Type=notify in my mythtv-backend.service file (as Richard
pointed out.) I don't think the frontend needs to wait on mysql as the
backend already does that (on my box.)

And, finally, graphical-session.target doesn't exist on my 17.04 Ubuntu
host, so I used graphical.target.

And really finally, note that my executable is in /usr/local/bin, adjust
as needed.

-- 
Bill


More information about the mythtv-users mailing list