Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: shutdown/reboot hangs when nfs has been mounted (Read 4297 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #45
OK. I want to thank you @ndowens and @Dudemanguy for your time.

I can't wait to test out iwd-suite66 once it's there!

Hope y'all enjoying your day wherever you are. Greetings from Poland! :)

EDIT:
I had this message the first time around when shutdown went well. I'll test it once again with the modified iwd script.

I just pushed new iwd-suite66, hopefully this will work. May need to do 66-enable -F iwd once you get it

Re: shutdown/reboot hangs when nfs has been mounted

Reply #46
Just to recap, this is the SOLUTION.

/etc/66/service/iwd
Code: [Select]
[main]
@type = longrun
@description = "iNet Wireless Daemon"
@version = 0.0.1
@user = ( root )

[start]
@execute = ( /usr/lib/iwd/iwd )

[stop]
@execute = ( umount -a -t nfs  )

after that you run
Code: [Select]
# 66-enable -t default -F iwd

As for the fstab error, now I'm not getting it, so it must've been a one-time-thing.

Dang that's a bummer that did not work. Maybe there's more to nfs mounts than I expected. In the meantime, we'll try to adjust the stop/finish scripts which is worth it anyway. Could you post the output of cat /proc/mounts with your nfs mounted? I'm not sure what nfs mounts look like in that file (so we know what to grep for exactly).

/proc/mounts
Code: [Select]
srv:/ /nfs/srv nfs4 rw,nosuid,nodev,noexec,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.52,local_lock=none,addr=192.168.1.115 0 0


Re: shutdown/reboot hangs when nfs has been mounted

Reply #47
Rev 3 of iwd-suite66 uses the [stop] how you had it, so should work

Re: shutdown/reboot hangs when nfs has been mounted

Reply #48
I'm waiting for the mirrors to sync and once everything works, I'm going to mark this thread as solved :)

EDIT: DAMN IT. Now the system hangs. I don't know what happened since the last time. Let me do some more testing.

EDIT2: @ndowens so apparently, I was trying to
Code: [Select]
umount -t nfs -a
while I should be doing
Code: [Select]
umount -t nfs4,nfs -a

The latter option appears to work. Please account for it in the iwd-suite66 package.

BTW, I downgraded suite66 from gremlins to system, and did  MNT_NETFS=!no in 66-env -t boot -e $EDITOR boot@system

Thank you! :)

Re: shutdown/reboot hangs when nfs has been mounted

Reply #49
I'm waiting for the mirrors to sync and once everything works, I'm going to mark this thread as solved :)

EDIT: DAMN IT. Now the system hangs. I don't know what happened since the last time. Let me do some more testing.

EDIT2: @ndowens so apparently, I was trying to
Code: [Select]
umount -t nfs -a
while I should be doing
Code: [Select]
umount -t nfs4,nfs -a

The latter option appears to work. Please account for it in the iwd-suite66 package.

BTW, I downgraded suite66 from gremlins to system, and did 
Code: [Select]
MNT_NETFS=!yes
in 66-env -t boot -e $EDITOR boot@system

Thank you! :)
Thanks for clarifying, I removed suite66 from testing and will re-adjust the stop scripts

Re: shutdown/reboot hangs when nfs has been mounted

Reply #50
Hi guys!

I'm sorry to say this but the above solution does not work in my case, at least. It works when you manually run
Code: [Select]
66-stop iwd
but it doesn't work when you shutdown the system when an nfs share is still mounted.

I'm sorry to have misled you on this, but apparently I did stop iwd when testing it for the first time  :(  

I'll do more troubleshooting and I'll play around with the iwd script more, but still I would appreciate some more opinions on this from the more experienced suite66 users.

Best,
Matt

Re: shutdown/reboot hangs when nfs has been mounted

Reply #51
@mattz7 can you edit /etc/66/service/iwd and change umount -a -t .. to umount -f -a -t ... and 66-enable -F iwd and see if that helps

 

Re: shutdown/reboot hangs when nfs has been mounted

Reply #52
@mattz7 can you edit /etc/66/service/iwd and change umount -a -t .. to umount -f -a -t ... and 66-enable -F iwd and see if that helps

Thanks for the reply :)

Funny thing is it worked now, but let me double check, boot up the system once again, mount the nfs and shutdown again :P

EDIT:
OK, the second time it worked, too.

I'll edit /etc/66/services/iwd and delete the -f option, do 66-enable -F iwd and see if it doesn't work. If it doesn't work, it means you nailed it! :)

EDIT2:

So I reverted the changes in iwd, re-enabled the service, mounted nfs and shutdown the computer. Only this time, it worked too.

Sorry for all this misleading information, but seriously I have such a mindf*** right now. I don't know what has changed since the last time, but apparently now it works.


EDIT3: OK, not it hangs, so I guess I know what happened. The change needs a reboot for it to work. So my hypothesis on the spot is, the -f option really makes a difference.

What I'll do is I'll add the -f option again, re-enable iwd, power off the computer, turn it back on, mount the nfs share and power it off. This'll be the ultimate test.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #53
Thanks for the reply :)

Funny thing is it worked now, but let me double check, boot up the system once again, mount the nfs and shutdown again :P

EDIT:
OK, the second time it worked, too.

I'll edit /etc/66/services/iwd and delete the -f option, do 66-enable -F iwd and see if it doesn't work. If it doesn't work, it means you nailed it! :)

EDIT2:

So I reverted the changes in iwd, re-enabled the service, mounted nfs and shutdown the computer. Only this time, it worked too.

Sorry for all this misleading information, but seriously I have such a mindf*** right now. I don't know what has changed since the last time, but apparently now it works.
As long as it works :)

Re: shutdown/reboot hangs when nfs has been mounted

Reply #54
BTW, do you know why the -f option would make a difference here? Because I don't get it.

I'll check the -f option a couple more times.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #55
BTW, do you know why the -f option would make a difference here? Because I don't get it.

I'll check the -f option a couple more times.
It is suppose to help a bit with hangs with nfs unmounts and such, but not guaranteed to do so. But I am adding the change to the scripts, to maybe help avoid this even more in the future.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #56
Great news. I'm looking forward to you pushing the change to the repos.

Now I'm thinking, maybe the [stop] part is executed after the IWD process is killed. But then again, running 66-stop iwd manually unmounted the share even though it didn't have the -f option. I'm confused...

As for the testing, I checked the -f option after a reboot, and now shutting down works like a charm after mounting the nfs share.

A big thank you to y'all! :) 

EDIT:

@ndowens @Dudemanguy Alas, there is one more hitch. When shutting down from my KDE plasma desktop, so I believe through elogind, the shutdown process hangs.

When shutting down from TTY, the shutdown process is smooth like butter.

EDIT2:

Running
Code: [Select]
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:false
also works. I need to do more research and testing and I'll get back to you with my findings if I get them.

EDIT3: So running
Code: [Select]
loginctl poweroff
also causes the system to hang while shutting down.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #57
That's very odd. I always presumed that loginctl poweroff would simply just call the poweroff binary on your machine. So there shouldn't be any difference. Somehow something must be different with that call.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #58
I always just use terminal to reboot or shutdown. Where did you use the dbus-send cmd?

Side note, I just pushed update elogind-suite66 package that cleans up a bit of it, though I doubt it helps in this situation. I updated mount-cgroups to do partly what elogind script was doing.

Re: shutdown/reboot hangs when nfs has been mounted

Reply #59
EDIT3: So running
Code: [Select]
loginctl poweroff
also causes the system to hang while shutting down.
It seems that loginctl currently calls shutdown -h, not physically powering down the computer. You can use shutdown -p now to do that. I changed my sdmenu script (which I use as a shutdown menu) in my fork of dwm to do that.

I think the goal should be to eventually move away from loginctl as part of systemd anyway.