OpenWrt Forum Archive

Topic: shutdown command

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello all,

where can i find and install "shutdown" command ?

thanks for replies

Given that these little routers don't have much in the way of power management or init system, I'm not sure you can really do a "shutdown" per se, a halt might have to do.

I wondered if you'd have to build a custom busybox to get a halt command, until I checked the source code for busybox's halt command.

All it does is send SIGUSR1 to the init process, i.e. process #1.

This small shell script will do the job:

#!/bin/sh
# halt:  stops the system

kill -USR1 1

Note that this is an immediate halt.

USR2 will similarly reboot the system.

Now if you'll excuse me, I'm going to go power cycle my halted router tongue

(Last edited by TylerM on 18 May 2007, 16:25)

heu, i would like to use "shutdown" command to shutdown PCs on my lan, not to shutdown my router...

thanks

The discussion might have continued from here.