Skip to main content
Topic: mount-net hangs on shutdown without network (Read 355 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

mount-net hangs on shutdown without network

To reproduce: mount an NFS, disable network and shutdown.
Reason: umount -f may hang. We should use umount -l in case of shutdown, as per man page.
I don't have a perfect way to fix this. It is reasonable to let the command hang when it is invoked manually by the user. But this is undesirable in case of system shutdown.
I am now using this down script:
Code: [Select]
#!/bin/execlineb -P
if -nt { s6-maximumtime -k 3000 umount -aft nfs4,nfs -O _netdev }
umount -alt nfs4,nfs -O _netdev
But this is not ideal: first it does not distinguish the two cases (manual invocation vs shutdown), and second s6-maximumtime fails to kill the umount -f and outputs a warning (which I don't understand).
To distinguish the two cases I can think of adding a line to the rc.shutdown script, but then it will no longer be a neat call to s6-rc.

Re: mount-net hangs on shutdown without network

Reply #1
If using -l instead of -f doesn't hang, that seems reasonable to me. I'd expect 99% of time this script is called would be when a user is shutting down so I don't think there's much utility and trying to accommodate for the random person that might invoke this with s6-rc manually.

Re: mount-net hangs on shutdown without network

Reply #2
By the way, is there any reason against using -t when bringing down all s6-rc services?

 

Re: mount-net hangs on shutdown without network

Reply #3
If you mean the timeout parameter on the s6-rc call on shutdown, not particularly no. What we're using is basically just the default that s6-linux-init generates and it hasn't really been a problem in general.