Artix Linux Forum

Init systems => S6 => Topic started by: wsb on 05 September 2022, 20:29:57

Title: mount-net hangs on shutdown without network
Post by: wsb on 05 September 2022, 20:29:57
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.
Title: Re: mount-net hangs on shutdown without network
Post by: Dudemanguy on 05 September 2022, 22:04:19
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.
Title: Re: mount-net hangs on shutdown without network
Post by: wsb on 05 September 2022, 23:25:56
By the way, is there any reason against using -t when bringing down all s6-rc services?
Title: Re: mount-net hangs on shutdown without network
Post by: Dudemanguy on 05 September 2022, 23:48:23
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.