[systemd-devel] ExecStartPre checking conf

Reindl Harald h.reindl at thelounge.net
Sun May 19 10:26:39 UTC 2019

Am 19.05.19 um 11:45 schrieb Olaf van der Spek:
> ExecStartPre is sometimes used to check the configuration. Does this make sense?
> It seems this causes a lot of code to run twice, as the configuration
> is checked on the real invocation anyway.
> [Unit]
> Description=Lighttpd Daemon
> After=network-online.target
> [Service]
> Type=simple
> PIDFile=/var/run/lighttpd.pid
> ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
> ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
> ExecReload=/bin/kill -USR1 $MAINPID
> Restart=on-failure
> [Install]
> WantedBy=multi-user.target

in my opinion not really

it could be useful if would be a "ExecRestartPre" to prevent the stop
action in case of a syntax error but if the unit fail because of
ExecStartPew or a failure of ExecStart don't make much difference

More information about the systemd-devel mailing list