ALT Linux Bugzilla
– Attachment 657 Details for
Bug 5553
Unmount filesystems by fs type
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Patch to support unmounting of filesystems by type
filesystems.patch (text/plain), 2.09 KB, created by
Sviatoslav Sviridov
on 2004-11-23 01:45:56 MSK
(
hide
)
Description:
Patch to support unmounting of filesystems by type
Filename:
MIME Type:
Creator:
Sviatoslav Sviridov
Created:
2004-11-23 01:45:56 MSK
Size:
2.09 KB
patch
obsolete
>--- ../bak/filesystems 2004-11-07 15:46:38 +0200 >+++ filesystems 2004-11-23 00:33:50 +0200 >@@ -4,7 +4,10 @@ > AddConfigHandler FilesystemsOptions > AddConfigHelp "Unmount <mount point or device> [...]" "If you have network shares or external devices that should be unmounted before suspending, list them here." > AddConfigHelp "Mount <mount point or device> [...]" "If you have network shares or external devices that should be mounted after resuming, list them here." >+AddConfigHelp "UnmountFSTypes <fylesystem type> [...]" "Unmount fylesystems by type. Useful for unmounting all filesystems of specific type which are not in /etc/fstab, e.g. manually mounted cifs or smbfs fylesystems" >+AddConfigHelp "UnmountSleepTime <number>[smhd]" "Time to sleep before sending SIGKILL for processes using filesystems to be unmounted. The parameter value is a number of seconds, suffix has the same meaning as for sleep(1)" > >+sleeptime=1 > FilesystemsUnmount() { > local mnt > local ret >@@ -24,7 +27,7 @@ FilesystemsUnmount() { > done > fi > >- [ "$needsleep" -eq 1 ] && sleep 1 >+ [ "$needsleep" -eq 1 ] && sleep $sleeptime > > # Send KILL to processes and unmount > ret=0 >@@ -54,6 +57,22 @@ FilesystemsMount() { > return $ret > } > >+FSTypesUnmount() { >+ local fstype >+ [ -z "$FS_TYPES" ] && return 0 >+ >+ ret=0 >+ FS_UNMOUNTS_SAVE="$FS_UNMOUNTS" >+ for fstype in $FS_TYPES; do >+ FS_UNMOUNTS=`awk '($3 == "'$fstype'") {print $2}' /proc/mounts |sort -r` >+ vecho 2 "Filesystems of type \"$fstype\" to unmount: $FS_UNMOUNTS" >+ FilesystemsUnmount || ret=1 >+ done >+ >+ FS_UNMOUNTS="$FS_UNMOUNTS_SAVE" >+ return $ret >+} >+ > FilesystemsOptions() { > case $1 in > unmount) >@@ -61,11 +80,20 @@ FilesystemsOptions() { > shift > FS_UNMOUNTS="$FS_UNMOUNTS $@" > ;; >+ unmountfstypes) >+ [ -z "$FS_TYPES" ] && AddSuspendHook 45 FSTypesUnmount >+ shift >+ FS_TYPES="$FS_TYPES $@" >+ ;; > mount) > [ -z "$FS_MOUNTS" ] && AddResumeHook 50 FilesystemsMount > shift > FS_MOUNTS="$FS_MOUNTS $@" > ;; >+ unmountsleeptime) >+ shift >+ sleeptime="$1" >+ ;; > *) > return 1 > esac
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5553
: 657