Reboot or init 6.

Nio Wiklund nio.wiklund at gmail.com
Wed Nov 28 17:15:49 UTC 2012


On 2012-11-28 15:01, Phill Whiteside wrote:
> the difference appears to be that init 6 calls the /etc/init.d scripts to
> halt processes whilst reboot does not?
> 
> Regards,
> 
> Phill.
> 
> On 28 November 2012 10:07, Nio Wiklund <nio.wiklund at gmail.com> wrote:
> 
>> On 2012-11-28 08:54, Brendan Donegan wrote:
>>> On 28/11/12 06:59, Carla Sella wrote:
>>>> I use shutdown -r now.
>>>> I'm used to UNIX, so I got this habit, in SCO UNIX it used to be
>>>> shutdown -g0.
>>> I also use shutdown now -r
>>>>
>>>> Carla Sella
>>>> email: carla.sella at gmail.com <mailto:carla.sella at gmail.com>
>>>> https://launchpad.net/~carla-sella <
>> https://launchpad.net/%7Ecarla-sella>
>>>>
>>>>
>>>>
>>>> On Wed, Nov 28, 2012 at 12:45 AM, Phill Whiteside <PhillW at ubuntu.com
>>>> <mailto:PhillW at ubuntu.com>> wrote:
>>>>
>>>>     Hi,
>>>>
>>>>     as there are times that machines in test mis-behave and we have
>>>>     (hopefully) still got access to a terminal. Which of these do you
>>>> use?
>>>>
>>>>     "init 6" performs reboot in a clean and orderly manner,informing
>>>>     the daemon of the change in runlevel,which subsequently achieves
>>>>     the appropriate milestone and ultimately executes the rc0 kill
>>>>     scripts.
>>>>
>>>>     "reboot" performs an immediate system reboot,does not execute the
>>>>     rc0 kill scripts,simply unmounts file systems and reboots the
>>>>     System. It is not recommended,especially when you are rebooting
>>>>     after a live-upgrade of OS & any patch-updates ,etc.
>>>>
>>>>     I'm not sure if "shutdown -y -i6 -g0" still is an option ( I used
>>>>     it many years ago on restarting Unix systems but it is calling
>>>> init 6)
>>>>
>>>>     Regards,
>>>>
>>>>     Phill.
>>>>
>>>>
>>
>> --
>> https://wiki.ubuntu.com/phillw
>>
>>
>> from  man reboot (in 12.04 LTS)
>> -----------------------------------------------------------
>> NAME
>>        reboot, halt, poweroff - reboot or stop the system
>>
>> SYNOPSIS
>>        reboot [OPTION]...
>>
>>        halt [OPTION]...
>>
>>        poweroff [OPTION]...
>>
>> DESCRIPTION
>>        These programs allow a system administrator to reboot,
>>        halt or poweroff the system.
>>
>>        When called with --force or when in runlevel 0 or 6,
>>        this tool invokes the reboot(2) system call itself and
>>        directly reboots the system.  Otherwise this simply
>>        invokes the shutdown(8) tool with the appropriate
>>        arguments.
>>
>>        Before  invoking  reboot(2), a shutdown time record is
>>        first written to
>>        /var/log/wtmp
>> -----------------------------------------------------------
>> so 'reboot' and 'shutdown -r now' should do the same thing.
>>
>> Is this really different from 'init 6'?
>>
>> --
>> Ubuntu-quality mailing list
>> Ubuntu-quality at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-quality
>>
I try to understand reading the man pages of init and telinit:
-----------------------------------------------------------
init(8)
...
NOTES
       init is not normally executed by  a  user  process,  and
       expects  to  have a process id of 1.  If this is not the
       case, it will actually execute telinit(8) and  pass  all
       arguments  to  that.   See  that manual page for further
       details.
-----------------------------------------------------------
telinit(8)
...
DESCRIPTION
       telinit may be used to change the system runlevel.

       The  RUNLEVEL  argument  should be one of the multi-user
       runlevels 2-5, 0 to halt the system,  6  to  reboot  the
       system  or  1  to bring the system down into single-user
       mode.

       Normally you would use the shutdown(8) tool to  halt  or
       reboot  the  system,  or to bring it down to single-user
       mode.
-----------------------------------------------------------
Conclusion: these man pages recommends the shutdown command




More information about the Ubuntu-quality mailing list