Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: "halt" does not power off on Ubuntu Server 12.04

  1. #11
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: "halt" does not power off on Ubuntu Server 12.04

    Quote Originally Posted by caraboy View Post
    I have the same problem, "halt -p" seems to work though.

    I don`t mind using this command, as long as the machine stops, but this should be written somewhere, as I lost all night trying to find an answer to why the system was not shutting down.
    Glad you were able to find a solution.

    I just wish they had documented thing change somewhere, but I have a feeling it is a bug. Have you added that the bug affects you to the report in post #9?
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  2. #12
    Join Date
    Sep 2008
    Beans
    1

    Smile Re: "halt" does not power off on Ubuntu Server 12.04

    hello,

    try to edit /etc/init.d/halt and remove this lines:

    Code:
    if [ "$INIT_HALT" = "HALT" ]
    then
      poweroff=""
    fi
    below
    Code:
    poweroff="-p"
    this fixes the problem for me.

    Dennis
    Last edited by CharlesA; September 14th, 2012 at 04:31 PM. Reason: code tags

  3. #13
    Join Date
    Dec 2007
    Location
    /home
    Beans
    483

    Smile Re: "halt" does not power off on Ubuntu Server 12.04

    I'm pretty sure that's no bug, but rather standard, expected, behaviour.

    Shutdown invokes several scripts to properly stop all running processes and, finally, invokes halt.

    It seems that, in many cases, halt has been symlinked to shutdown, so that running sudo halt will have the same effect as sudo shutdown -h now, but it's really not the same.

    halt -p would be correct.

    man halt would give you some more info.
    Don't eff with The Cult...

  4. #14
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: "halt" does not power off on Ubuntu Server 12.04

    Glad you were able to figure out how to work around the issue.

    I have just learned to use poweroff if I want to power the box down.

    Thanks.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #15
    Join Date
    Jan 2013
    Beans
    1

    Re: "halt" does not power off on Ubuntu Server 12.04

    Had the same issue and learnt that halt command should not be used to shut down a Linux OS as other Unixes, shutdown must be use instead to properly shut down a Linux box.

    I guess halt, poweroff and reboot commands (at least) should not be in PATH but in /usr/lib/upstart to avoid confusion.

  6. #16
    Join Date
    May 2011
    Beans
    5

    Re: "halt" does not power off on Ubuntu Server 12.04

    It's clear that "halt" command now by default does not power off unless you use -p option.
    But why does it not respect the setting from /etc/default/halt?
    etc/init.d/halt sources the default file but its used only if $INIT_HALT is empty.
    It seems though that when I call halt, $INIT_HALT has allready value HALT.
    So I forced it to act on information from /etc/default/halt, by commenting out the if statement.
    /etc/init.d/halt:

    Code:
    do_stop () {    
         #if [ "$INIT_HALT" = "" ]
        #then
            case "$HALT" in
              [Pp]*)
                INIT_HALT=POWEROFF
                ;;
              [Hh]*)
                INIT_HALT=HALT
                ;;
              *)
                INIT_HALT=POWEROFF
                ;;
            esac
        #fi
    
    Last edited by ulabunt; May 18th, 2013 at 12:02 AM.

  7. #17
    Join Date
    Oct 2008
    Beans
    81
    Distro
    Ubuntu

    Re: "halt" does not power off on Ubuntu Server 12.04

    Quote Originally Posted by CharlesA View Post
    It just says "system halted" like it did on Lucid except it doesn't power the box off. "halt -p", "poweroff", "shutdown -h now" all power the box off fine.

    I updated the launchpad bug asking if this is intended or what, but no response as of yet.

    Guess I'll just have to learn a new command as I've always use halt to power off an *nix machine. *shrugs*

    EDIT: Filed a new bug report:
    https://bugs.launchpad.net/ubuntu/+s...rt/+bug/991997
    Thank you for clarification. I've been using halt for long but it doesnt work on 12.04LTS. Should use 'halt -p' now on.

  8. #18
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: "halt" does not power off on Ubuntu Server 12.04

    Quote Originally Posted by johnycage View Post
    Thank you for clarification. I've been using halt for long but it doesnt work on 12.04LTS. Should use 'halt -p' now on.
    Welcome.

    Getting in the habit of using poweroff hasn't been that big of a deal, and now I don't have to worry about the machine being running but not powered off.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •