[systemd-devel] Script in /usr/lib/systemd/system-shutdown not executed on init 6

Lennart Poettering lennart at poettering.net
Wed Nov 23 10:55:26 UTC 2016


On Wed, 23.11.16 08:18, Benoit SCHMID (Benoit.Schmid at unige.ch) wrote:

> Hello,
> 
> I have added a simple script in /usr/lib/systemd/system-shutdown.
> The scripts echo a message (on stdout) and create a file in /var/tmp.
> I manually tested the script before rebooting to ensure that it
> works fine.

The scripts dropped there are executed very late during the shutdown
process at a time where all processes have already been killed and all
mount points have been unmounted or at least remounted
read-only. Touching a file in /var is hence simply not possible.

it's really executed right before the reboot() system call is issued.

See the docs, specifically, systemd-shutdown(8).

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list