> 5) in old initscripts, there was /etc/init.d/halt with section
for ups
> shutdown. With that script gone, was that functionality ported to
> systemd
> somehow?
Well, any such code is just inherently broken. It *cannot* work. A
number of kernel subsystems hook into the shutdown code of the
kernel. For example storage code syncs meta data to disk after the
reboot() syscall is invoked. If you however turn off power before
reaching reboot(), then this step is omitted which might trigger data
loss. UPS code like that needs to sit in the kernel itself to properly
work. Adding userspace kludges which invokes this from userspace is a
recipe for desaster. The point of UPS is to prevent data loss after all,
and if you turn off the power before the kernel dealt with reboot() you
invite data loss. (And no, just adding random sleeps, is not a fix, it
just delays the problem.)
(That all said you may drop binaries into /lib/systemd/system-shutdown
which are executed right before invoking reboot(). But if you package
anything that drops binaries into that dir
...
how can automake & friends use this directory?
FOO=$(pkg-config --variable=systemdsystemunitdir systemd)/../system-shutdown
(or FOO=$(dirname $(pkg-config --variable=systemdsystemunitdir systemd)
)/system-shutdown
or is there a better way for this?