Bug#344547: please use "-f" in umount

2005-12-23 Thread Robert Millan
Package: initscripts
Version: 2.86.ds1-6
Severity: wishlist
Tags: patch

Hi,

There's a bug in kFreeBSD which causes killall5 not to work properly (actualy,
not to work at all).  In this conditions, it is common that umounting a
local filesystem or remounting / as readonly fail, because there is a stale
process using these filesystems.

I think it'd be a good thing if "-f" was always passed to umount and to "mount
-o ro,remount", since AFAICT there's no situation in which, during system halt
sequence, you'd want such operations to abort, leaving the kernel with
filesystems mounted read-write, thus potentialy causing corruption in the fs.

Please consider this patch.  It should be harmless if your system works
properly, but can prevent problems in awkward situations like this one.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL 
set to C)

Versions of packages initscripts depends on:
ii  coreutils5.93-5  The GNU core utilities
ii  dpkg 1.13.11.0.1 package maintenance system for Deb
ii  e2fsprogs1.38-2  ext2 file system utilities and lib
ii  libc62.3.5-8.1   GNU C Library: Shared libraries an
ii  lsb-base 3.0-11  Linux Standard Base 3.0 init scrip
ii  util-linux   2.12p-8 Miscellaneous system utilities

initscripts recommends no packages.

-- no debconf information
diff -ur sysvinit-2.86.ds1.old/debian/initscripts/etc/init.d/umountfs 
sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountfs
--- sysvinit-2.86.ds1.old/debian/initscripts/etc/init.d/umountfs
2005-12-23 18:23:17.485223000 +0100
+++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountfs2005-12-23 
18:23:59.258873280 +0100
@@ -38,7 +38,7 @@
 esac
DIRS="$DIRS $DIR"
 done
-umount -r -d $DIRS
+umount -f -r -d $DIRS
 )
 log_action_end_msg $?
 
diff -ur sysvinit-2.86.ds1.old/debian/initscripts/etc/init.d/umountroot 
sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountroot
--- sysvinit-2.86.ds1.old/debian/initscripts/etc/init.d/umountroot  
2005-12-23 18:23:17.500221000 +0100
+++ sysvinit-2.86.ds1/debian/initscripts/etc/init.d/umountroot  2005-12-23 
18:24:06.497772800 +0100
@@ -21,7 +21,7 @@
 
 do_stop () {
 [ "$VERBOSE" != no ] && log_action_begin_msg "Mounting root filesystem 
read-only"
-mount -n -o remount,ro /
+mount -f -n -o remount,ro /
 [ "$VERBOSE" != no ] && log_action_end_msg $?
 }
 


Bug#344547: [Pkg-sysvinit-devel] Bug#344547: please use "-f" in umount

2005-12-23 Thread Thomas Hood
Robert Millan wrote:
> I think it'd be a good thing if "-f" was always passed to umount

umount(8) says:

   -f Force unmount (in case of an unreachable NFS system).  (Requires
  kernel 2.1.116 or later.)

So the -f option has an effect on kFreeBSD too?

-- 
Thomas Hood


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#344547: [Pkg-sysvinit-devel] Bug#344547: please use "-f" in umount

2005-12-24 Thread Robert Millan
On Fri, Dec 23, 2005 at 10:36:41PM +0100, Thomas Hood wrote:
> Robert Millan wrote:
> > I think it'd be a good thing if "-f" was always passed to umount
> 
> umount(8) says:
> 
>-f Force unmount (in case of an unreachable NFS system).  (Requires
>   kernel 2.1.116 or later.)
> 
> So the -f option has an effect on kFreeBSD too?

Yes.  Though we don't use the same mount/umount command, most basic flags are
the same.

>From http://www.freebsd.org/cgi/man.cgi?query=umount

 -f  The file system is forcibly unmounted.  Active special devices
 continue to work, but all other files return errors if further
 accesses are attempted.  The root file system cannot be forcibly
 unmounted.

>From  http://www.freebsd.org/cgi/man.cgi?query=mount

 -f  Forces the revocation of write access when trying to downgrade a
 file system mount status from read-write to read-only.  Also
 forces the R/W mount of an unclean file system (dangerous; use
 with caution).

-- 
Robert Millan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]