xorbit / LiFePO4wered-Pi

Access library, command line tool and daemon for the LiFePO4wered/Pi module
GNU General Public License v2.0
132 stars 31 forks source link

Use systemd-specific shutdown invocation #51

Closed mmirate closed 3 years ago

mmirate commented 3 years ago

On OSes who don't bend themselves over backwards in an attempt at sysvinit-compatibility, /sbin/init 0 does not shut down the system, but rather executes systemd itself in a non-PID1 context which it does not understand.

A reasonable alternative is systemctl poweroff.

Ideally poweroff could be used unilaterally, since both systemd and sysvinit OSes include a program by that name which accomplishes the named task when executed without argument; however, there is no agreement as to whether it should be in /usr/bin, /sbin, etc etc.

A reliable location of systemctl itself, is dictated by the usr-merge; see https://serverfault.com/a/978288.

xorbit commented 3 years ago

Thank you for your contribution!