Skip to content

Commit

Permalink
Add ZED to zfs.redhat.in script
Browse files Browse the repository at this point in the history
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 openzfs#3153
  • Loading branch information
dun authored and DeHackEd committed Apr 5, 2015
1 parent 1421131 commit c0f9da2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/init.d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
6 changes: 6 additions & 0 deletions etc/init.d/zfs.redhat.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
}
Expand Down

0 comments on commit c0f9da2

Please sign in to comment.