diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/common.sh.in | 9 | ||||
-rwxr-xr-x | scripts/zfs.sh | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 3f63fc053..ae1c5cf09 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -38,6 +38,7 @@ sbindir=@sbindir@ udevdir=@udevdir@ udevruledir=@udevruledir@ sysconfdir=@sysconfdir@ +localstatedir=@localstatedir@ ETCDIR=${ETCDIR:-/etc} DEVDIR=${DEVDIR:-/dev/disk/by-vdev} @@ -72,6 +73,8 @@ SYSCTL=${SYSCTL:-/sbin/sysctl} UDEVADM=${UDEVADM:-/sbin/udevadm} AWK=${AWK:-/usr/bin/awk} +ZED_PIDFILE=${ZED_PIDFILE:-${localstatedir}/run/zed.pid} + COLOR_BLACK="\033[0;30m" COLOR_DK_GRAY="\033[1;30m" COLOR_BLUE="\033[0;34m" @@ -745,3 +748,9 @@ stack_check() { fi fi } + +kill_zed() { + if [ -f $ZED_PIDFILE ]; then + kill $(cat $ZED_PIDFILE) + fi +} diff --git a/scripts/zfs.sh b/scripts/zfs.sh index f44053e88..b21d2e7cf 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -65,6 +65,7 @@ if [ $(id -u) != 0 ]; then fi if [ ${UNLOAD} ]; then + kill_zed umount -t zfs -a stack_check unload_modules |