init.d scripts for shutdown and reboot

Kailesh Mussai kmussa at cs.mcgill.ca
Thu Dec 11 14:40:09 UTC 2008


On Thu, Dec 11, 2008 at 12:28:22AM -0000, Cameron Hutchison wrote:

> Kailesh Mussai <kmussa at cs.mcgill.ca> writes:
> 
> >I am trying to understand how ubuntu does a shutdown.  From what I
> >understand in the rc0.d, here is a part of ls -l:
> 
> >root at turkana:/etc/rc0.d# ls -l
> 
> >lrwxrwxrwx 1 root root  13 2008-10-10 11:45 K01gdm -> ../init.d/gdm
> >---snip----
> >lrwxrwxrwx 1 root root  22 2008-10-10 11:45 S31umountnfs.sh -> ../init.d/umountnfs.sh
> >lrwxrwxrwx 1 root root  17 2008-10-14 10:30 S32portmap -> ../init.d/portmap
> >lrwxrwxrwx 1 root root  20 2008-10-10 11:45 S35networking -> ../init.d/networking
> >lrwxrwxrwx 1 root root  18 2008-10-10 11:45 S40umountfs -> ../init.d/umountfs
> >lrwxrwxrwx 1 root root  20 2008-10-10 11:45 S60umountroot -> ../init.d/umountroot
> >lrwxrwxrwx 1 root root  14 2008-10-10 11:45 S90halt -> ../init.d/halt
> 
> >The init scripts umountnfs.sh, umountfs, umountroot do nothing when
> >started but only when stopped, an example is:
> 
> >root at turkana:/etc/rc0.d# /etc/init.d/umountfs start # No-op
> 
> >The reason I am asking is, 
> 
> I'm not sure what you're asking, as there is no question in your
> message.
> 
> It may help you to know that in runlevels 0 and 6, the S* scripts are
> run with the "stop" argument. In the other runlevels, the S* scripts are
> run with the "start" argument. For all runlevels, K* scripts are run
> with the "stop" argument.
> 
> 
> -- 
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
+-------------------

Thank you Cameron, that does help me understand why they would have the
init.d/umount* as S* scripts in runlevel 0 and 6.

I am trying to understand the shutdown process, as our own custom setup
is failing to umount the local drive giving us "resource is busy" before
shutting down.

Hence my question is how does the shutdown process works, especially the
part where the unmounting is concerned?

Best,
Kailesh 




More information about the ubuntu-users mailing list