views:

65

answers:

4

Can anyone link up the source of the halt tool? It is a binary usually located in /sbin which shuts down the system. I did some search and I couldn't find it anywhere.

+1  A: 

Here's a version of halt from busybox. The linux/bsd/whatever one is probably similar in many ways, although a little more elaborate :)

http://www.google.com/codesearch/p?hl=en#EKZaOgYQHwo/unstable/sources/busybox-1.2.1.tar.gz%7C5l79Bld9wLE/busybox-1.2.1/init/halt.c&q=halt.c%20lang:c

This URL appears to have a copy of the sysvinit source:

ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.86.tar.gz

The halt source should be in that archive.

Gian
A: 

Maybe try /sbin/, some tools like shutdown are located there. If you are looking to restart your computer give:

shutdown -r now

Mike
+4  A: 

In Ubuntu at least, /sbin/halt is a symlink to /sbin/reboot, which is a part of upstart. Get it here.

Pedro Silva