shutdown command

PleegWat pleegwat at telfort.nl
Tue Feb 14 17:59:28 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/14/2012 06:15 PM, Ioannis Vranos wrote:
> On Tue, Feb 14, 2012 at 12:58 PM, Chris Green <cl at isbd.net> wrote:
>> The command line shutdown command has been around since the early
>> days of Unix.  Many other commands are just different ways of
>> calling it.
>> 
>> Looking at /sbin it seems that halt and poweroff are symbolic
>> links to reboot but shutdown is actually different.  However the
>> man page for reboot says that (except for some specific options)
>> reboot calls shutdown.
>> 
>> So basically it's shutdown at the bottom of all these commands.
> 
> I can't understand the following. poweroff and halt, are symbolic 
> links of /sbin/reboot. How all 3 have different outcome (poweoff, 
> halt, and reboot respectively)?

An executable can detect what name was used to invoke it. When using a
symbolic link, the name of the link (rather than its target) is used.

So basically, reboot does one thing if it was invoked as reboot,
another when invoked as halt, and a third when invoked as poweroff.

PleegWat

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPOqD7AAoJEAM6sLJjDJaMqgIH/jbAhjlhOXTG0/G/UH01h+kx
1JileLo7NW5nVc9Tbq01MU6dns815JZ71ZA7brakNbGJ/fgLCv8bpd2OfCk4EPG4
x0BleF2ewlNI2MWltNJwtYnUUCFS8T1BW1R5U1DnKi4sYnM2rpFHKMONKIBRv+/3
C1FKz3/MVyWdAnZiPNdznDUO11fKfOsQgXvk9xCh5TnVAyTsUVgzavEFkJacZ5H+
TH6idGI8Uge+UcN9Nmg/XT/U0IDpurtfIeywWr4GxOGjPSc6xanPAc6jCMlGfEuE
fkef69f+jh5nQsmoXoEyIeDiCiN4HOMWq8jIv7w+ePJG97TsXNMcEDSq57mpKno=
=HyA+
-----END PGP SIGNATURE-----




More information about the ubuntu-users mailing list