[systemd-devel] I need a killall.service in beta fc 15 (systemd installed by default)

Lennart Poettering lennart at poettering.net
Mon May 9 14:18:39 PDT 2011


On Sun, 08.05.11 13:01, Floydsmith at aol.com (Floydsmith at aol.com) wrote:

> I guess this might be somthing like:
> cd /
> ln -sf  ../../../lib/systemd/system/3.target
> etc/systemd/system/default.target
> but  with 3 replaced by 6 (for shutdown).
>
> I need such a service so that I on shutdown I can have a script (like
> killall) do custom things with the BIOS time and backup a few files.
>
> How to I create such a service?
>
> Any help will be greatly appreciated.

As Kay mentioned you can stick a binary or script in
/lib/systemd/system-shutdown and it will be executed immediately before
reboot() is invoked.

Alternatively you can just write a systemd service and hook it before
shutdown.target (to run it in parallel with all other shutdown stuff) or
after shutdown.target & before final.target (to run it after the normal
shutdown but before handing things off to the binary that calls reboot()).

Lennart

--
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list