How does one reboot from an ash shell?

41,604

Solution 1

I was looking for the same, and my BusyBox installation doesn't have shutdown, restart or reboot commands.

I used poweroff -f because poweroff with no parameters doesn't do anything.

If the previous command doesn't work, try to do a ls -la /bin or a ls -la /sbin to see which commands are available on your BusyBox installation.

As user6214440 stated, if your installation doesn't has a good path environment you should need to execute the command with full path like /sbin/reboot or /sbin/poweroff

Solution 2

Do you not have the reboot or shutdown commands? reboot without arguments should reboot your box, or 'shutdown -r now' should also do it.

Solution 3

On my Alpine box running an ash shell, the command for shutting down completely is poweroff. I noticed it does the same thing as the more familiar shutdown -h now I usually deal with on my CentOS box.

Solution 4

tested on BusyBox v1.18.4 (2011-03-18 03:57:01 EDT) multi-call binary

Some BusyBox versions also restart with a forced reboot command:

reboot -f

reboot --help

for more information.

Share:
41,604
Urhixidur
Author by

Urhixidur

Started programming back in the late 1970s (FORTRAN and APL at first, later C and Pascal) on mainframes, then my own 8-bit Atari (BASIC, 6502 assembler) and so on ever since. I'm also quite active in various Wikimedia projects, using the same handle.

Updated on July 09, 2022

Comments

  • Urhixidur
    Urhixidur almost 2 years

    How does one reboot from an ash shell?

    I have an Ubuntu system that is currently bricked for some reason (not pertinent for this question), which means I boot into a BusyBox ash shell. But the exit command does squat, and reset is irrelevant. There must be a better way to reboot than the power button, right?

  • kmarks2
    kmarks2 about 12 years
    He's probably running a super pared down system, and for whatever reason /sbin is not in his path. Try "/sbin/shutdown -r now".
  • Urhixidur
    Urhixidur about 12 years
    Thanks for the tips: if I'm ever in the same bind, I'll try these.
  • Peter Mortensen
    Peter Mortensen over 6 years
    Related: For a restart instead of power off, use the reboot command.
  • Urhixidur
    Urhixidur almost 4 years
    Except that you need to reboot in order to launch the live USB Linux operating system. Faced with the ash command line, you can't get there.
  • Admin
    Admin about 3 years
    reboot alone did nothing here. Needed do go with the absolute path /bin/reboot. Same goes for poweroff.