aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/fusefs-kmod
diff options
context:
space:
mode:
authorstefan <stefan@FreeBSD.org>2008-12-12 23:10:52 +0800
committerstefan <stefan@FreeBSD.org>2008-12-12 23:10:52 +0800
commit8309cc0055f9ba859cbb0d83a1ffd6a06148dd63 (patch)
tree545dcddb2eb257e064071a618150d8d86a993689 /sysutils/fusefs-kmod
parentb810f12faba8b16a864fa94a93f7ebf6b630925c (diff)
downloadfreebsd-ports-gnome-8309cc0055f9ba859cbb0d83a1ffd6a06148dd63.tar.gz
freebsd-ports-gnome-8309cc0055f9ba859cbb0d83a1ffd6a06148dd63.tar.zst
freebsd-ports-gnome-8309cc0055f9ba859cbb0d83a1ffd6a06148dd63.zip
Add knobs to the rc.d script to safely wait until all data has been written on
shutdown. (As this implies pausing rc.shutdown's shutdown watchdog, the knobs are off by default.) PR: 124901 Submitted by: Dominic Fandrey <kamikaze@bsdforen.de> Approved by: maintainer
Diffstat (limited to 'sysutils/fusefs-kmod')
-rw-r--r--sysutils/fusefs-kmod/Makefile2
-rw-r--r--sysutils/fusefs-kmod/files/fusefs.in34
2 files changed, 33 insertions, 3 deletions
diff --git a/sysutils/fusefs-kmod/Makefile b/sysutils/fusefs-kmod/Makefile
index d2746e73a177..ea21b42314e0 100644
--- a/sysutils/fusefs-kmod/Makefile
+++ b/sysutils/fusefs-kmod/Makefile
@@ -7,7 +7,7 @@
PORTNAME= fusefs
DISTVERSION= 0.3.9-pre1.20080208
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= sysutils kld
MASTER_SITES= http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/
PKGNAMESUFFIX= -kmod
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"