Comment 21 for bug 1532553

Revision history for this message
Michael Biebl (mbiebl) wrote :

fwiw, halt-local.service was hooked up in final.target and contains the following:

[Unit]
Description=/usr/sbin/halt.local Compatibility
ConditionFileIsExecutable=/usr/sbin/halt.local
DefaultDependencies=no
After=shutdown.target
Before=final.target

To apply that to my /etc/systemd/system/foo.service example:

[Unit]
Description=Run service on shutdown
DefaultDependencies=no
After=shutdown.target
Before=final.target

[Service]
ExecStart=/bin/true

[Install]
WantedBy=final.target

Then run "systemctl enable foo.service" and you should be set.