]> git.ipfire.org Git - thirdparty/systemd.git/commit
shutdown: fix arguments to /run/initramfs/shutdown
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 6 Nov 2014 21:24:13 +0000 (22:24 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Thu, 6 Nov 2014 21:33:08 +0000 (22:33 +0100)
commit4b5d8d0f22ae61ceb45a25391354ba53b43ee992
treef4f48544d2d1883c0fda22d33b469df78c6ce27d
parenta0132af247c4781bb821ab6b9e1e4f564f0c9fde
shutdown: fix arguments to /run/initramfs/shutdown

Our initrd interface specifies that the verb is in argv[1].
This is where systemd passes it to systemd-shutdown, but getopt
permutes argv[]. This confuses dracut's shutdown script:
  Shutdown called with argument '--log-level'. Rebooting!

getopt can be convinced to not permute argv[] by having '-' as the first
character of optstring. Let's use it. This requires changing the way
non-option arguments (in our case, the verb) are processed.

This fixes a bug where the system would reboot instead of powering off.
src/core/shutdown.c