diff options
author | Stefan Walter <stefan@FreeBSD.org> | 2008-12-12 15:10:52 +0000 |
---|---|---|
committer | Stefan Walter <stefan@FreeBSD.org> | 2008-12-12 15:10:52 +0000 |
commit | dd458ecd60848f52da02f311fd5a7423a012914e (patch) | |
tree | 0da9d22478ae0be21fb7631f4d4ecc7b83068d9a /sysutils/fusefs-kmod/files | |
parent | 64e5930e908916d2f2b1744c9f0be9f8eab329e7 (diff) |
Notes
Diffstat (limited to 'sysutils/fusefs-kmod/files')
-rw-r--r-- | sysutils/fusefs-kmod/files/fusefs.in | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sysutils/fusefs-kmod/files/fusefs.in b/sysutils/fusefs-kmod/files/fusefs.in index 3b5d97afacbc..bec25ead9780 100644 --- a/sysutils/fusefs-kmod/files/fusefs.in +++ b/sysutils/fusefs-kmod/files/fusefs.in @@ -13,6 +13,14 @@ # fusefs_enable (bool): Set to NO by default. # Set it to YES to enable fusefs. # +# fusefs_safe (bool): Set to NO by default. +# Set it to YES to wait for all write operations +# to finish before terminating. +# +# fusefs_safe_evil (bool): Set to NO by default. +# Set it to YES to pause the watchdog timer +# while waiting for write operations. +# . %%RC_SUBR%% @@ -46,14 +54,36 @@ fusefs_stop() case "$dev" in /dev/fuse[0-9]*) echo "fusefs: unmounting ${mountpoint}." - umount $mountpoint + umount -f $mountpoint ;; esac done - kldunload $kmod + if checkyesno "${name}_safe_evil"; then + if [ -n "$_rcshutdown_watchdog" ]; then + echo "fusefs: pausing watchdog timer." + kill -STOP "$_rcshutdown_watchdog" + fi + fi + if checkyesno "${name}_safe"; then + printf "fusefs: unloading $kmod... " + while ! kldunload $kmod 2> /dev/null; do + sleep 0.25 + done + echo "done." + else + kldunload $kmod + fi + if checkyesno "${name}_safe_evil"; then + if [ -n "$_rcshutdown_watchdog" ]; then + echo "fusefs: continuing watchdog timer." + kill -CONT "$_rcshutdown_watchdog" + fi + fi } load_rc_config $name : ${fusefs_enable="NO"} +: ${fusefs_safe="NO"} +: ${fusefs_safe_evil="NO"} run_rc_command "$1" |