[opensuse-factory] NFS and hibernation
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I post this here because I want to add a feature that should not be too dificult. I can write the script, but I need some help with two doubts. I think it is known that the kernel oopses when trying to hibernate a machine and there is an NFS mount (Bug 568132). I wondered if I could create an script in /etc/pm/sleep.d/ that detects there is an NFS mount active, and aborts hibernation warning the user. But my 1st problem is how to detect there is an NFS mount? I tried this: mount | grep "type nfs" but it fails because it hits on: nfsd on /proc/fs/nfsd type nfsd (rw) Maybe I'm foggy now and can't make grep get what I want - too little sleep tonight :-) Perhaps showmount, but I don't know how to make it show only imported filesystems. And after that, I need something in the /etc/pm/sleep.d/00_checknfs script that aborts the process. Some result code, perhaps? Perhaps someone of the devs here knows about that one? - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEUEARECAAYFAkzb1iMACgkQtTMYHG2NR9Ut8QCeJyyusooPVqimo5hrbr0ITlZQ tfUAmJDLXt5nXGyyOmLKpMR03nbX/qg= =cW0j -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2010-11-11 at 12:40 +0100, Carlos E. R. wrote: This script will abort the hibernate process if there is an NFS mount active. I propose that somebody takes this (modified as appropiate) and add it to all active releases. At least for factory (Bug 568132) /etc/pm/sleep.d/5nfscheck: #!/bin/bash . /usr/lib/pm-utils/functions RETVAL=0 case "$1" in hibernate|suspend) MONTADO=`mount | grep "type nfs" | grep -v "/proc/fs/nfsd"` if test -n "$MONTADO" ; then RETVAL=1 #This does not abort. touch $INHIBIT #This does. MESSAGE="Aborting hibernation process because there is an NFS mount active. Touched $INHIBIT" /bin/logger -t pm-utils -p syslog.warn $MESSAGE echo -e "$MESSAGE\r" > /dev/tty0 echo -e "--> $MONTADO\r" > /dev/tty0 echo "$MESSAGE Touched $INHIBIT" fi ;; thaw|resume) ;; *) ;; esac exit $RETVAL # Idea for $INHIBIT in /usr/lib/pm-utils/sleep.d/30s2disk-check - -- Cheers, Carlos E. R. (from 11.2 x86_64 "Emerald" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkzcgeIACgkQtTMYHG2NR9Uj6ACfVaeliEMrr1GpFBVosgCZ5rDC sYYAn0TMCVNh8psvk6lZ60ge/0KqoVjz =zFOa -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Fri, 12 Nov 2010 00:52:59 +0100 (CET) "Carlos E. R." <carlos.e.r@opensuse.org> wrote:
On Thursday, 2010-11-11 at 12:40 +0100, Carlos E. R. wrote:
This script will abort the hibernate process if there is an NFS mount active. I propose that somebody takes this (modified as appropiate) and add it to all active releases. At least for factory (Bug 568132)
/etc/pm/sleep.d/5nfscheck:
#!/bin/bash
. /usr/lib/pm-utils/functions
RETVAL=0 case "$1" in hibernate|suspend) MONTADO=`mount | grep "type nfs" | grep -v "/proc/fs/nfsd"` if test -n "$MONTADO" ; then
if egrep -q '^\S+ \S+ nfs '; then # ... inhibit suspend ... fi But I still think that this is the wrong approach. My system suspends fine with NFS mounts, if they don't have dirty buffers. The kernel should be fixed if this does not work reliably. Shipping workarounds like this one only makes sure that the real bug is never fixed. -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
Am Freitag, 12. November 2010, 08:25:59 schrieb Stefan Seyfried:
But I still think that this is the wrong approach. My system suspends fine with NFS mounts, if they don't have dirty buffers.
The kernel should be fixed if this does not work reliably. Shipping workarounds like this one only makes sure that the real bug is never fixed.
Difficult due to the way the freezer works. We cannot freeze tasks in state D, but NFS requires (due to POSIX) some operations to be uninterruptible. Regards Oliver -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Fri, 12 Nov 2010 10:26:40 +0100 Oliver Neukum <oneukum@suse.de> wrote:
Difficult due to the way the freezer works. We cannot freeze tasks in state D, but NFS requires (due to POSIX) some operations to be uninterruptible.
Well but the kernel knows at freeze time if it has dirty data and then can fail suspend immediately - not after 20 seconds timeout. Or flush dirty data before freezing (I know, race condition). Combined with usable feedback to the user, this would be perfectly fine and would not unconditionally kill all suspend attempts, just because there is an unused NFS mount somewhere on the system. -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2010-11-12 at 10:30 +0100, Stefan Seyfried wrote:
On Fri, 12 Nov 2010 10:26:40 +0100 Oliver Neukum <> wrote:
Difficult due to the way the freezer works. We cannot freeze tasks in state D, but NFS requires (due to POSIX) some operations to be uninterruptible.
Well but the kernel knows at freeze time if it has dirty data and then can fail suspend immediately - not after 20 seconds timeout. Or flush dirty data before freezing (I know, race condition). Combined with usable feedback to the user, this would be perfectly fine and would not unconditionally kill all suspend attempts, just because there is an unused NFS mount somewhere on the system.
I agree that the kernel should notice and abort - who best can know? And it would be better still if it could hibernate safely - but it doesn't. But the fact is that I'm having crashes when I forget to umount nfs. I wrote that script because just the day before I had a dirty crash with a lot of errors dumps, hundred of lines to the log. I had to stop alll my desktop tasks with opened data, and power off. I prefer to have that hack than having my system crash and waste a lot of time when I just want the system to sleep. At worst, leave the hack as optional, disabled. Or enabled telling the user how to disable and try if hibernation works again. - -- Cheers, Carlos E. R. (from 11.2 x86_64 "Emerald" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkzdM9AACgkQtTMYHG2NR9XfUwCePz7CY9LIR17yh9TbIpA+goTA 9kAAnj+6FtZVCYtZIBbTtgmX8So4UCUO =hEDA -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
participants (4)
-
Carlos E. R.
-
Carlos E. R.
-
Oliver Neukum
-
Stefan Seyfried