Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250920 - sys-apps/baselayout-1.12.11.1: /etc/init.d/netmount does not detect failure to unmount nfs filesystem
Summary: sys-apps/baselayout-1.12.11.1: /etc/init.d/netmount does not detect failure t...
Status: RESOLVED DUPLICATE of bug 239347
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-14 12:04 UTC by Francis Barber
Modified: 2009-01-15 12:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Barber 2008-12-14 12:04:18 UTC
When the argument "stop" is passed to /etc/init.d/netmount it attempts to unmount all network filesytems.  There is code that checks if umount printed any errors, and tries again after calling fuser if umount failed.

On my system (using umount from sys-apps/util-linux-2.13.1.1), "umount -a" fails silently, so filesystems might be left unmounted.

Perhaps netmount should check /proc/mounts to see if it worked as expected regardless.  I'm happy to provide a patch to this effect if required.

The thing triggering this for me is gconfd-2, which keeps a file open in my NFS-mounted home directory for 30 seconds after I log out (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500430).  This means that if I try to shutdown my computer from within GNOME, /home/frank doesn't get unmounted before /etc/init.d/rpc.statd gets stopped.  Later, /etc/init.d/halt.sh tries to unmount it, but it can't so the machine just sits there waiting indefinitely.

Reproducible: Always

Steps to Reproduce:
1. Open a file on an NFS filesystem.
2. /etc/init.d/netmount stop
Actual Results:  
netmount says "Unmounting network filesystems... [ ok ], but NFS filesystems with in-use files are not unmounted.

Expected Results:  
netmount calls fuser -k for the filesystems that failed to be unmounted and tries to unmount them again.

Portage 2.1.4.5 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.7-r2, 2.6.27 x86_64)
=================================================================
System uname: 2.6.27 x86_64 Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz
Timestamp of tree: Fri, 12 Dec 2008 09:45:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -ggdb -march=core2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -ggdb -march=core2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks metadata-transfer sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://mirror.3fl.net.au/pub/gentoo/ http://mirror.pacific.net.au/linux/Gentoo ftp://mirror.pacific.net.au/linux/Gentoo ftp://ftp.planetmirror.com/pub/gentoo/ http://ftp.swin.edu.au/gentoo http://gentoo.gg3.net/ "
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi alsa amd64 audacious avahi bash-completion berkdb bzip2 cli cracklib crypt cups curl cursors dbus device-mapper dri dts dv dvd encode esd fat ffmpeg firefox fortran gcj gdbm gdm gedit gif gimpprint git gnome gpm gtk hal hbci icons iconv ieee1394 imlib ipv6 isdnlog java jfs jpeg mad mdnsresponder-compat midi mjpeg mmx mmxext mozsvg mp3 mp4 msn mudflap multilib nautilus ncurses network nls nptl nptlonly nsplugin ntfs ofx ogg opengl openmp oss pam pcre pdf perl png pppd python qt-static quicktime quotes readline reflection samba sdl session smp spell spl sse sse2 ssl subversion svg sysfs syslog tcpd tetex theora tiff tk truetype unicode v4l vim-pager vorbis winbind wmf x264 xml xorg xscreensaver xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fglrx vmware radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Johan Ymerson 2009-01-15 10:46:31 UTC
A fix is available in the bug report #239347.

Please mark bug as a duplicate of 239347.

In essence, the problem is that netmount stop() calls umount with option -r (to remount ro if umount failes), however the remount will lock. Remove the -r option and fuser will kill off the left over processes.
Comment 2 Francis Barber 2009-01-15 12:10:05 UTC
(In reply to comment #1)
> A fix is available in the bug report #239347.

I agree that these bugs are duplicate.  However, removing the -r option does not fully address the problem.  netmount current assumes that umount will output a message to stdout or stderr if it can't unmount one of the devices.  This is not the case on my system.  Consequently, the fuser and re-attempts will never be executed.
Comment 3 Panagiotis Christopoulos (RETIRED) gentoo-dev 2009-01-15 12:15:32 UTC

*** This bug has been marked as a duplicate of bug 239347 ***