[systemd-devel] proper way for shutdown script

Lennart Poettering lennart at poettering.net
Fri Oct 7 08:02:37 UTC 2016


On Thu, 06.10.16 20:30, Xen (list at xenhideout.nl) wrote:

> Lennart Poettering schreef op 06-10-2016 19:12:
> 
> >The way to have a process executed at shutdown is by using ExecStop=
> >and making sure the unit is started at start-up time.
> >
> >Current systemd versions permit unit files without any ExecStart= to
> >cover for this case, really old systemd versions didn't like that, in
> >which case you need to specify ExecStart=/bin/true for them.
> 
> Didn't realize this. Reason was that when I ..provided a command without
> path... it first complained about the command being invalid.... but also
> then that there was no ExecStart defined which was a problem to it ... ?
> 
> So I assumed at that point that I couldn't leave it out.
> 
> I have 229.

Note that ExecStart= may only be left out if a unit is of Type=oneshot
and has at least one ExecStop= set.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list