Re: Linux shutdown/reboot process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.... :)

On Mon, May 14, 2012 at 6:31 PM, Asutosh Das <das.asutosh@xxxxxxxxx> wrote:
> Hi List
> I have a query about the linux shutdown or reboot process.

I am not so keen about this issue. Actually, the whole sequence is
combination of user space and kernel space.

> Please can you let me know if the below sequence is correct:
>
> When reboot command is given on the shell:
>
> 1. all user-space process is frozen (by sending some signal ?? )

I think it is done by simply sending kill -TERM to all processes, then
followed by kill -KILL in case some of them are stubborn to die :)

> 2. all file-systems are remounted as read-only - (sysrq handler does this ?? )

IMHO it is done this way:
mount -o remount, ro

> 3. all drivers, whose shutdown handlers have been defined, are called
> in the reverse order in which these drivers were initialized.
>

I am not sure, perhaps you mean it is part of unloading those drivers?

> I am not sure what happens after this.

what I am quite sure, in the end it tries to shutdown the machine via
ACPI commands (or APM?). And before that, it tries to park the hard
disk head, again using some sort of ioctls I guess.

Sorry if it doesn't help much...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux