Bug#760923: halt no longer powers off the machine

Christian Seiler christian at iwakd.de
Sat May 9 12:41:32 BST 2015


> - changing finger memory is difficult, so I keep entering
>   'halt' instead of 'poweroff' occasionally

I had the same problem, so I added the following to my /root/.bashrc on
Jessie so I can retrain my finger memory:

------------------------------------------------------------------------
# Make sure we poweroff the system by default (i.e. display message if
# just 'halt' is called)
_prompting_halt() {
    if [ $# -eq 0 ] ; then
        echo -n "Did you really want to use just 'halt'? " >&2
        echo "That will not poweroff the system." >&2
        echo "To really halt the system, use:" >&2
        echo "  /sbin/halt" >&2
        echo "Otherwise, to poweroff, use one of the following:" >&2
        echo "  poweroff" >&2
        echo "  halt -p" >&2
        echo "  shutdown -h (if /etc/default/halt is properly set)" >&2
        echo "  shutdown -P" >&2
        return 1
    fi
    /sbin/halt "$@"
}
alias halt='_prompting_halt'
------------------------------------------------------------------------

(This uses an alias in order to make sure that it doesn't break
non-interactive shell scripts.)

I think one could have made a good argument before the release of Jessie
to revert to the (broken) previous default (and perhaps print a message
saying that this will change in Stretch), but changing it yet again is
a really bad idea in my eyes.

Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150509/a542fb24/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list