aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorChris Dunlap <[email protected]>2015-03-05 13:11:05 -0800
committerBrian Behlendorf <[email protected]>2015-03-05 14:07:04 -0800
commit0e86d309ccc53e7d6093f8cf2bb09858f63267ac (patch)
tree1c1201d83cb5ca2de60636000f9daaeaa277d301 /etc
parenta7b9d0c3a0a8df42d557eb7ffa4e959c25debe69 (diff)
Add ZED to zfs.redhat.in script
This commit updates the zfs.redhat.in script to start/stop ZED. Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #3153
Diffstat (limited to 'etc')
-rw-r--r--etc/init.d/Makefile.am1
-rw-r--r--etc/init.d/zfs.redhat.in6
2 files changed, 7 insertions, 0 deletions
diff --git a/etc/init.d/Makefile.am b/etc/init.d/Makefile.am
index 72093484c..7cdcdd780 100644
--- a/etc/init.d/Makefile.am
+++ b/etc/init.d/Makefile.am
@@ -15,6 +15,7 @@ $(init_SCRIPTS):
-e 's,@udevruledir\@,$(udevruledir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
-e 's,@initdir\@,$(initdir),g' \
+ -e 's,@runstatedir\@,$(runstatedir),g' \
'$@.$(DEFAULT_INIT_SCRIPT).in' >'$@'
distclean-local::
diff --git a/etc/init.d/zfs.redhat.in b/etc/init.d/zfs.redhat.in
index 7a4cae861..8cdaceb5f 100644
--- a/etc/init.d/zfs.redhat.in
+++ b/etc/init.d/zfs.redhat.in
@@ -26,6 +26,8 @@
. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/zfs
+ZED="@sbindir@/zed"
+ZED_PIDFILE="@runstatedir@/zed.pid"
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
ZPOOL_CACHE="/etc/zfs/zpool.cache"
@@ -55,6 +57,9 @@ start()
# Load the zfs module stack
/sbin/modprobe zfs
+ # Start the ZED for event handling
+ action $"Starting ZFS Event Daemon" daemon --pidfile="$ZED_PIDFILE" "$ZED"
+
# Ensure / exists in /etc/mtab, if not update mtab accordingly.
# This should be handled by rc.sysinit but lets be paranoid.
awk '$2 == "/" { exit 1 }' /etc/mtab
@@ -102,6 +107,7 @@ stop()
action $"Unsharing ZFS filesystems" "$ZFS" unshare -a
action $"Unmounting ZFS filesystems" "$ZFS" umount -a
+ action $"Shutting down ZFS Event Daemon" killproc -p "$ZED_PIDFILE" "$ZED"
rm -f "$LOCKFILE"
}