Add systemd unit file for zed

This commit adds a systemd unit file for zed.service and integrates
it into the zfs.target from commit 881f45c.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2108
Issue #2
This commit is contained in:
Chris Dunlap 2014-03-11 12:33:32 -07:00 committed by Brian Behlendorf
parent 9e246ac3d8
commit 11a7043324
3 changed files with 20 additions and 2 deletions

View File

@ -1,15 +1,17 @@
systemdpreset_DATA = \ systemdpreset_DATA = \
$(top_srcdir)/etc/systemd/system/50-zfs.preset $(top_srcdir)/etc/systemd/system/50-zfs.preset
systemdunit_DATA = \ systemdunit_DATA = \
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service \ $(top_srcdir)/etc/systemd/system/zed.service \
$(top_srcdir)/etc/systemd/system/zfs-import-cache.service \ $(top_srcdir)/etc/systemd/system/zfs-import-cache.service \
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service \
$(top_srcdir)/etc/systemd/system/zfs-mount.service \ $(top_srcdir)/etc/systemd/system/zfs-mount.service \
$(top_srcdir)/etc/systemd/system/zfs-share.service \ $(top_srcdir)/etc/systemd/system/zfs-share.service \
$(top_srcdir)/etc/systemd/system/zfs.target $(top_srcdir)/etc/systemd/system/zfs.target
EXTRA_DIST = \ EXTRA_DIST = \
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service.in \ $(top_srcdir)/etc/systemd/system/zed.service.in \
$(top_srcdir)/etc/systemd/system/zfs-import-cache.service.in \ $(top_srcdir)/etc/systemd/system/zfs-import-cache.service.in \
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service.in \
$(top_srcdir)/etc/systemd/system/zfs-mount.service.in \ $(top_srcdir)/etc/systemd/system/zfs-mount.service.in \
$(top_srcdir)/etc/systemd/system/zfs-share.service.in \ $(top_srcdir)/etc/systemd/system/zfs-share.service.in \
$(top_srcdir)/etc/systemd/system/zfs.target.in \ $(top_srcdir)/etc/systemd/system/zfs.target.in \
@ -17,12 +19,14 @@ EXTRA_DIST = \
$(systemdunit_DATA): $(systemdunit_DATA):
-$(SED) -e 's,@bindir\@,$(bindir),g' \ -$(SED) -e 's,@bindir\@,$(bindir),g' \
-e 's,@runstatedir\@,$(runstatedir),g' \
-e 's,@sbindir\@,$(sbindir),g' \ -e 's,@sbindir\@,$(sbindir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \
'$@.in' >'$@' '$@.in' >'$@'
$(systemdpreset_DATA): $(systemdpreset_DATA):
-$(SED) -e 's,@bindir\@,$(bindir),g' \ -$(SED) -e 's,@bindir\@,$(bindir),g' \
-e 's,@runstatedir\@,$(runstatedir),g' \
-e 's,@sbindir\@,$(sbindir),g' \ -e 's,@sbindir\@,$(sbindir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \
'$@.in' >'$@' '$@.in' >'$@'

View File

@ -0,0 +1,13 @@
[Unit]
Description=ZFS Event Daemon (zed)
Documentation=man:zed(8)
After=zfs-import-cache.service
After=zfs-import-scan.service
[Service]
Type=forking
ExecStart=@sbindir@/zed
PIDFile=@runstatedir@/zed.pid
User=root
Group=root
Restart=on-abort

View File

@ -2,6 +2,7 @@
Description=ZFS startup target Description=ZFS startup target
Requires=zfs-mount.service Requires=zfs-mount.service
Requires=zfs-share.service Requires=zfs-share.service
Wants=zed.service
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target