[mythtv] Systemd expertise needed: systemctl fails to start mythbackend

Richard Shaw hobbes1069 at gmail.com
Thu Jul 5 21:17:47 UTC 2012


If you use --daemon you need to specify a PID file because systemd has
no way of knowing what the PID of the forked process is without one.

Before I figured that out I wrote the below which you may still find useful...

Richard


Does the backend need to run as a certain user? It's possible that
systemd isn't running as the same user as your are manually.

Here's an excerpt of the service file I use for Fedora/RPM Fusion:

[Unit]
Description=MythTV backend service
After=network.target mysqld.service
# uncomment the following line if you will be using the mythweb plugin.
#Wants=httpd.service

[Service]
Type=simple
Environment=MYTHCONFDIR=/etc/mythtv
Environment=HOME=/usr/share/mythtv
User=mythtv
ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv

[Install]
WantedBy=multi-user.target
--- end ---

Type forking is assumed unless you say otherwise. In that case you
will need to specify --daemon, but with systemd it's actually better
to run Type=simple and not use the --daemon option so you don't have
to mess with a PID file.


More information about the mythtv-dev mailing list