Systemd unit file: Can/Should ExecStart and ExecStop run a script?

Lennart Poettering mzerqung at
Wed Oct 19 20:29:45 UTC 2011

On Wed, 19.10.11 18:58, "Jóhann B. Guðmundsson" (johannbg at wrote:

> This is what I wrote a while back for mythtv in rpmfusion but never 
> submitted since I could not find someone to test it.
> Note this got picked up by someone and adapted to atrpm version the 
> other day.
> Cant recall if that indvidual pinged me on irc or on some mailing list.
> #cat mythbackend.service
> [Unit]
> Description=MythTV Backend
> mysqld.service

The is unnecessary these days and should be removed
to keep things simple.

> [Service]
> Type=forking
> PIDFile=/run/
> Environment=MYTHCONFDIR=/etc/mythtv
> Environment=HOME=/etc/mythtv

Is this really necessary? $HOME is something that should be set
according to the user something is run as. And it should be set in the
same code that drops the privileges.

> ExecStart=/usr/bin/mythbackend --daemon --logfile 
> /var/log/mythtv/mythbackend.log --pidfile /run/
> StandardError=syslog

We now default to syslog logging, so I can only recommend to drop this
line here, in order not to override the system-wide setting.


Lennart Poettering - Red Hat, Inc.

More information about the devel mailing list