Bug 54639

Summary: autofs fails to shut down properly when automounted device is busy
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: autofsAssignee: Jeff Moyer <jmoyer>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: jmm
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-31 00:41:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Kamens 2001-10-15 01:06:35 UTC
With autofs-3.1.7-21, uto.misc uncommented in auto.master, and a CD in the
drive but not yet mounted:

root@jik:~!38# service autofs start ; sleep 1 ; cd /misc/cd ; service
autofs stop
Starting automount:                                        [  OK  ]
umount2: Device or resource busy                           [  OK  ]
umount: automount(pid13054): not found
umount: /misc: Illegal seek
umount2: Device or resource busy
umount: automount(pid13054): not found
umount: /misc: Illegal seek

root@jik:/misc/cd!39# mount
/dev/hde7 on / type ext2 (rw)
none on /proc type proc (rw)
/dev/hdb1 on /b type ext2 (rw)
/dev/hda1 on /c type ext2 (rw)
/dev/hdg1 on /d type ext2 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hde1 on /nt/c type msdos (ro)
/dev/hde5 on /nt/d type ntfs (ro,umask=022)
/dev/hdg2 on /nt/e type ntfs (ro,umask=022)
automount(pid13054) on /misc type autofs
(rw,fd=5,pgrp=13054,minproto=2,maxproto=3)
/dev/cdrom on /misc/cd type iso9660 (ro,nosuid,nodev)

The two problems here are all the errors that get printed during "service
autofs stop" and the fact that automount(pid13054) remains mounted after
the service is stopped.

Comment 1 James Manning 2002-05-26 17:07:36 UTC
it's an actively-used mount - the only option would be forcing the umount, and
that's a bad route (imho) to take since letting automount hang around is much
worse than the possible problems with forced umounts (open files, dirty buffers,
mmap'd files, etc)

imho, the current "attempt but don't force" behavior is our best-case scenario.

The only change I could really see making is possibly an lsof/fuser kind of path
that upon failed shutdowns of the automounts, attempted to list to the
calling/root user (maybe logger'd too) which PID's are preventing the proper
shutdowns.  Additionally, we should probably get an error/non-zero return code
back to the init.d script enough to not print "OK" when this happens.

Comment 2 Jeff Moyer 2004-03-31 00:41:15 UTC
Functions as designed.