Bug#328582: /etc/init.d/umountfs: swapoff should be called before unmounting localfs and not after?
I believe the swapoff/umount order was changed to solve bug #84782, making sure tmpfs file systems are umounted before swap is turned off and thus improving the chance of not running out of memory for low-memory machines. I'm not sure how to modify umountfs to solve both problems. I agree that it should be possible to use swap files without having to run fsck at every boot, and that it should be possible to use tmpfs on some filesystems with fairly large data sets without having problems shutting down. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#328582: /etc/init.d/umountfs: swapoff should be called before unmounting localfs and not after?
On Wednesday 28 September 2005 00:59, you wrote: It already does that, in the (misnamed) umountnfs.sh script which runs before umountfs read it. Mike. hi mike, i fail to see how umountnfs.sh could call swapoff johannes == my umountnfs.sh: #! /bin/sh ### BEGIN INIT INFO # Provides: umountnfs # Required-Start: sendsigs # Required-Stop: # Default-Start: 6 # Default-Stop: # Short-Description: Unmount all network filesystems except the root file system. # Description: Also unmounts all virtual filesystems (proc, devfs, #devpts, usbfs, sysfs) that are not mounted at the #top-level. # #Also unmounts all virtual filesystems (proc, #devfs, devpts, usbfs, sysfs) that are not mounted #at the top-level. ### END INIT INFO # # Version: @(#)umountnfs 2.85-23 29-Jul-2004 [EMAIL PROTECTED] # PATH=/sbin:/bin:/usr/sbin:/usr/bin . /lib/lsb/init-functions KERNEL=`uname -s` RELEASE=`uname -r` case ${KERNEL}:${RELEASE} in Linux:[01].*|Linux:2.[01].*) FLAGS= ;; Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*) FLAGS=-f ;; *) FLAGS=-f -l ;; esac do_stop () { # Write a reboot record to /var/log/wtmp before unmounting halt -w # Remove any .clean files in auto-clean dirs. rm -f /tmp/.clean /var/lock/.clean /var/run/.clean log_begin_msg Unmounting remote and non-toplevel virtual filesystems... # # Read mtab file and add the directories we want to # unmount in reverse to a list. # ( DIRS= while read DEV DIR TYPE REST do case $DIR in /|/proc|/dev|/dev/pts|/proc/*|/sys) continue ;; esac case $TYPE in nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs) DIRS=$DIR $DIRS ;; proc|procfs|linprocfs|devfs|devpts|usbfs|usbdevfs|sysfs) DIRS=$DIR $DIRS ;; esac done exec /dev/null if [ -n $DIRS ] then umount $FLAGS $DIRS fi ) /etc/mtab log_end_msg 0 } case $1 in stop) do_stop ;; *) ;; esac : exit 0 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#328582: /etc/init.d/umountfs: swapoff should be called before unmounting localfs and not after?
On Fri, 2005-09-16 at 13:47 +0200, Marcel Sebek wrote: On Fri, Sep 16, 2005 at 10:55:37AM +0200, johannes wrote: hi all, i'm using a swapfile in a file on a local filesystem /data/swapfile (not a swap partition!) during shutdown /etc/init.d/umountfs first tries to unmount all local filesystems and then deactivates all swap but unmounting of the partitition wich has the swapfile /data fails because the swapfile is still active if i change /etc/init.d/umountfs in such a way that it first calls swapoff and then unmounts the local filesystems it works correctly It already does that, in the (misnamed) umountnfs.sh script which runs before umountfs read it. Mike. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#328582: /etc/init.d/umountfs: swapoff should be called before unmounting localfs and not after?
Package: initscripts Version: 2.86.ds1-2 Severity: normal hi all, i'm using a swapfile in a file on a local filesystem /data/swapfile (not a swap partition!) during shutdown /etc/init.d/umountfs first tries to unmount all local filesystems and then deactivates all swap but unmounting of the partitition wich has the swapfile /data fails because the swapfile is still active if i change /etc/init.d/umountfs in such a way that it first calls swapoff and then unmounts the local filesystems it works correctly -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.12 Locale: LANG=en_GB.ISO-8859-15, LC_CTYPE=en_GB.ISO-8859-15 (charmap=ISO-8859-15) Versions of packages initscripts depends on: ii coreutils 5.2.1-2.1 The GNU core utilities ii dpkg 1.13.11package maintenance system for Deb ii e2fsprogs 1.38-2 ext2 file system utilities and lib ii libc6 2.3.5-6GNU C Library: Shared libraries an ii lsb-base 3.0-5 Linux Standard Base 3.0 init scrip ii util-linux2.12p-7Miscellaneous system utilities initscripts recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#328582: /etc/init.d/umountfs: swapoff should be called before unmounting localfs and not after?
On Fri, Sep 16, 2005 at 10:55:37AM +0200, johannes wrote: hi all, i'm using a swapfile in a file on a local filesystem /data/swapfile (not a swap partition!) during shutdown /etc/init.d/umountfs first tries to unmount all local filesystems and then deactivates all swap but unmounting of the partitition wich has the swapfile /data fails because the swapfile is still active if i change /etc/init.d/umountfs in such a way that it first calls swapoff and then unmounts the local filesystems it works correctly I think it should unmount all tmpfs'es (except /dev and similar) first. Then it can safely turn off swapping. Doing it in reverse order could cause trouble in some configurations (eg. /tmp as tmpfs). Something like this: do_stop () { # Umount all memory filesystems except /dev log_begin_msg Unmounting memory filesystems... LANG=C sort -r -k 2 /etc/mtab | ( DIRS= while read DEV DIR TYPE REST ; do case $TYPE in tmpfs) ;; *) continue ;; esac case $DIR in /dev) continue ;; esac DIRS=$DIRS $DIR done umount -r -d $DIRS ) log_end_msg $? log_begin_msg Deactivating swap... swapoff -a log_end_msg $? # Umount all filesystems except root and the virtual ones log_begin_msg Unmounting local filesystems... # List all mounts, deepest mount point first LANG=C sort -r -k 2 /etc/mtab | ( DIRS= while read DEV DIR TYPE REST ; do case $DIR in /|/proc|/dev|/.dev|/dev/pts|/proc/*|/sys) continue # Ignoring virtual file systems needed later ;; esac case $TYPE in proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts) continue # Ignoring non-tmpfs virtual file systems ;; esac DIRS=$DIRS $DIR done umount -r -d $DIRS ) log_end_msg $? } -- Marcel Sebek signature.asc Description: Digital signature