[Pkg-sysvinit-commits] r733 - in sysvinit/trunk/debian: .
initscripts/etc/init.d
Thomas Hood
jdthood-guest at costa.debian.org
Fri Feb 3 09:49:34 UTC 2006
Author: jdthood-guest
Date: 2006-02-03 09:49:32 +0000 (Fri, 03 Feb 2006)
New Revision: 733
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/initscripts/etc/init.d/umountfs
Log:
Don't try to unmount tmpfs on /dev
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2006-02-02 21:30:23 UTC (rev 732)
+++ sysvinit/trunk/debian/changelog 2006-02-03 09:49:32 UTC (rev 733)
@@ -1,4 +1,4 @@
-sysvinit (2.86.ds1-12~10) unstable; urgency=low
+sysvinit (2.86.ds1-12~11) unstable; urgency=low
[ Thomas Hood ]
* Aim for testing: Closes: #341075
@@ -25,6 +25,7 @@
* checkroot.sh: Don't try to enable swap if a swap device is
/dev/mapper/* or a swapfile (Closes: #346329, #348534)
* checkroot.sh: Remove some code specific to pre-2.4-Linux
+ * umountfs: Don't try to unmount tmpfs on /dev (Closes: #350998)
* several scripts: messages: Tweak; better condition them on $VERBOSE
* initscripts postinst: Don't run mount{kern,devsub}fs.sh
* initscripts postinst: Actually remove some things on purge
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/umountfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/umountfs 2006-02-02 21:30:23 UTC (rev 732)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/umountfs 2006-02-03 09:49:32 UTC (rev 733)
@@ -17,49 +17,67 @@
umask 022
do_stop () {
- # Make sure tmpfs file systems are umounted before turning off
- # swap, to avoid running out of memory if the tmpfs filesystems
- # use a lot of space.
- #
- # Generally /dev is still in use at this point; we want to ignore
- # the error message and error code about that.
- [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting temporary filesystems"
- umount -a -t tmpfs 9>&2 2>&1 1>&9 | grep -v '/dev: device is busy' 9>&2 2>&1 1>&9
- [ "$VERBOSE" = no ] || log_action_end_msg 0
-
- [ "$VERBOSE" = no ] || log_action_begin_msg "Deactivating swap"
- swapoff -a >/dev/null
- ES=$?
- [ "$VERBOSE" = no ] || log_action_end_msg $ES
-
- # Umount all filesystems except root and the virtual ones
- [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting local filesystems"
-
# List all mounts, deepest mount point first
LC_ALL=C sort -r -k 2 /proc/mounts |
(
- DIRS=""
+ REG_MTPTS=""
+ TMPFS_MTPTS=""
while read DEV MTPT FSTYPE REST ; do
case "$MTPT" in
- /|/proc|/dev|/.dev|/dev/pts|/proc/*|/sys)
- continue # Ignoring virtual file systems needed later
+ /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys)
+ continue # Don't unmount file systems needed later
;;
esac
case "$FSTYPE" in
+ tmpfs)
+ TMPFS_MTPTS="$TMPFS_MTPTS $MTPT"
+ ;;
proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts)
- continue # Ignoring non-tmpfs virtual file systems
+ : # Don't unmount non-tmpfs virtual file systems
;;
+ *)
+ REG_MTPTS="$REG_MTPTS $MTPT"
+ ;;
esac
- DIRS="$DIRS $MTPT"
done
- if [ "$DIRS" ]
+
+ #
+ # Make sure tmpfs file systems are umounted before turning off
+ # swap, to avoid running out of memory if the tmpfs filesystems
+ # use a lot of space.
+ #
+ if [ "$TMPFS_MTPTS" ]
then
- umount -f -r -d $DIRS
+ [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting temporary filesystems"
+ umount $TMPFS_MTPTS
+ ES=$?
+ [ "$VERBOSE" = no ] || log_action_end_msg $ES
fi
+
+ #
+ # Deactivate swap
+ #
+ if [ "$VERBOSE" = no ]
+ then
+ swapoff -a >/dev/null
+ else
+ log_action_begin_msg "Deactivating swap"
+ swapoff -a -v
+ ES=$?
+ log_action_end_msg $ES
+ fi
+
+ #
+ # Unmount local filesystems
+ #
+ if [ "$REG_MTPTS" ]
+ then
+ [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting local filesystems"
+ umount -f -r -d $REG_MTPTS
+ ES=$?
+ [ "$VERBOSE" = no ] || log_action_end_msg $ES
+ fi
)
- ES=$?
-
- [ "$VERBOSE" = no ] || log_action_end_msg $ES
}
case "$1" in
More information about the Pkg-sysvinit-commits
mailing list