Linux shutdown/reboot process

Mulyadi Santosa mulyadi.santosa at gmail.com
Mon May 14 11:45:13 EDT 2012


Hi.... :)

On Mon, May 14, 2012 at 6:31 PM, Asutosh Das <das.asutosh at gmail.com> 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



More information about the Kernelnewbies mailing list