Bug#743555: initscripts: command "halt" unintended changed behaviour

Jesse Smith jsmith at resonatingmedia.com
Fri Mar 8 16:33:23 GMT 2019

This topic always gets confusing because so many different components
have the same name (halt). And how they behave will vary slightly,
depending on which version you use.

In the past, if you called /sbin/halt (with or without the -p flag), it
would call /sbin/shutdown -h. The INIT_HALT variable would not be set.
This would cause the /etc/init.d/halt script to check /etc/defaults/halt
to see if the computer should be powered off or not. Basically, whether
the computer was simply stopped or powered off depended on the contents
of /etc/defaults/halt.

With the current version of SysV init (2.94) the /sbin/halt command
works a little differently. One of two things happens:

1. The user runs /sbin/halt -p, this causes /sbin/shutdown -h -P to be
called. That in turns sets the INIT_HALT variable. Then, when
/etc/init.d/halt checks the value of INIT_HALT, it sees it needs to
power off the computer. The computer should turn off.

2. The user runs /sbin/halt without the "-p" flag. This runs
/sbin/shutdown -h. INIT_HALT is not set. The /etc/init.d/halt script
checks /etc/defaults/halt to see whether it should poweroff or simply stop.

In short, I think the original bug report was probably correct. The
/sbin/shutdown command was being called as "shutdown -h" when it should
have been called as "shutdown -h -P" in order versions of this package.
However, 2.94 and newer use the better behaviour (calling shutdown -h
-P) which means this bug report can be marked as "fixed upstream".

- Jesse

More information about the Debian-init-diversity mailing list