Find the answer to your Linux question:
Results 1 to 8 of 8
I'm assuming it was an update that did this, but the halt command no longer does anything. I can't turn the computer off, restart it, etc. This is what happens ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    Odessa, FL
    Posts
    586

    The "halt" command no longer works...


    I'm assuming it was an update that did this, but the halt command no longer does anything. I can't turn the computer off, restart it, etc.

    This is what happens when I try using any of the halt commands....in this example, it's to poweroff:
    Code:
    localhost josh # halt -p
    shutdown: No such file or directory
    localhost josh #
    How do I fix this? Now, when I try turning the computer off it doesn't do anything so I'm left holding the power button down to turn it off (which I'd rather not do)


    Thanks in advance

  2. #2
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    From the error it can't seem to find the shutdown command, so you could try and find it with
    Code:
    locate shutdown
    or
    Code:
    find / -iname shutdown
    and see if it's now outside your $PATH, and if it is add it to your $PATH.

    Of course you can try to halt the system with the
    Code:
    init 0
    command, which will switch you to runlevel 0 which halts the system.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  3. #3
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    Odessa, FL
    Posts
    586
    Quote Originally Posted by dylunio
    From the error it can't seem to find the shutdown command, so you could try and find it with
    Code:
    locate shutdown
    or
    Code:
    find / -iname shutdown
    and see if it's now outside your $PATH, and if it is add it to your $PATH.

    Of course you can try to halt the system with the
    Code:
    init 0
    command, which will switch you to runlevel 0 which halts the system.
    ok...so i did "locate shutdown" and found a couple of scripts that seem like it may be it:
    /etc/init.d/shutdown.sh
    /sbin/shutdown_script

    of course there were more, but the others didn't seem like THE shutdown script ...they just seemed like variations of it (kshutdown for example). what should i do? i'm sorry, i don't know which path the $PATH refers to. is that /usr/sbin/, /usr/bin/,...?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    Looking at my system shutdown is in /sbin/shutdown, and when I type
    Code:
    shutdown [options]
    it works since /sbin is in my path as root, as it should be on your system. I find it weird that you seem to have lost yours though.

    Maybe the best way to fix this would be to download a stage3 tarball and copying /sbin/shutdown from it?

    In the mean while you can come to a halt with
    Code:
    init 0
    or reboot with
    Code:
    init 6
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  6. #5
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666
    hmmm i halt still...
    Code:
    halt
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
    http://loft306.org

  7. #6
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    Quote Originally Posted by loft306
    hmmm i halt still...
    Code:
    halt
    Aye, but if your is runlevels 1-5 that just invokes shutdown -h, and josolanes doesn't seem to have shtdown for some weird reason
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  8. #7
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    Odessa, FL
    Posts
    586
    Quote Originally Posted by dylunio
    Looking at my system shutdown is in /sbin/shutdown, and when I type
    Code:
    shutdown [options]
    it works since /sbin is in my path as root, as it should be on your system. I find it weird that you seem to have lost yours though.

    Maybe the best way to fix this would be to download a stage3 tarball and copying /sbin/shutdown from it?

    In the mean while you can come to a halt with
    Code:
    init 0
    or reboot with
    Code:
    init 6
    well...i renamed the "shutdown_script" to "shutdown" and now shutdown [option] works....but halt [option] still doesn't. i don't know what happend. i have a strong feeling it's because of an update (i'm using the development branch....or have "~x86" in make.conf, so i get all of the unstable packages...maybe that's what caused these problems??)

    anyways, now i can atleast use shutdown [option]...i just have to get used to using it rather than halt [option], or maybe i'll just learn to use init [#] as it's even short. i don't know yet....but i'm glad i (kind of) got it fixed


    thanks for the help/suggestions

  9. #8
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    You could always alias halt to shutdown -h now


    Put the alias into root's ~/.bashrc file:
    Code:
    alias halt='shutdown -h now'
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

Posting Permissions

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