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.

durron597
  • 31,968
  • 17
  • 99
  • 158
Kristina
  • 15,859
  • 29
  • 111
  • 181

4 Answers4

4

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

Pedro Silva
  • 4,672
  • 1
  • 19
  • 31
1

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
  • 13,735
  • 44
  • 51
0

The code for NetBSD is here : http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/reboot/reboot.c?rev=1.35.4.1&content-type=text/x-cvsweb-markup

nos
  • 223,662
  • 58
  • 417
  • 506
-1

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

shutdown -r now

Mike
  • 733
  • 1
  • 7
  • 10