During shutdown/reboot Network Subsystem v/s Storage Subsystem

valdis.kletnieks at vt.edu valdis.kletnieks at vt.edu
Wed Mar 14 12:49:38 EDT 2018


On Wed, 14 Mar 2018 11:53:33 +0530, jitendra kumar khasdev said:

> eg. when we do shutdown, which (network or storage)stack goes down first?

Hint:

What order do these *have* to happen in?

What happens if you shut down the network before unmounting an NFS share, or if
you pixie-booted onto an iscsi-based rootfs?

What happens if you spin down the disks before the network is down? (Hint 2 - how
do you load /sbin/ifconfig to 'ifconfig em1 down' if the filesystem is unmounted?)

For bonus points, how do you shut down all of the storage stack before everything
else (since processes have a current working directory which will make the filesystem
"busy")?  And how do you unmount that last filesystem? :)

If you're lucky enough to still be running a sysvinit-based init, boot/shutdown is
controlled by the 'Knnwnatever' files in /etc/rc.d/rc5.d (usually), so perusing those
will tell you most of what happens during boot and shutdown. (The quick summary-
at startup, it runs all the S* scripts in order, S00whatever through S99whatever.
And 'man 8 init' should have all the gory details for you.

If you have systemd, you'll have to do a 'systemctl show' on each service,
look at all the Name/Requires/Conflicts/Before/After/TriggeredBy tags and
build an ordered graph of what gets called for what (keeping in mind that
things happen in parallel, so you'll have a bazillion units that all reference
network.service and a few other key checkpoints in the boot process)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180314/6499ea19/attachment.sig>


More information about the Kernelnewbies mailing list