From 1101b98c3bcf109feeb809177a6b52f173ea63ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= =?UTF-8?q?=E3=82=B4=E3=83=B3=E3=83=91=29?= Date: Wed, 2 Nov 2016 13:56:36 -0400 Subject: [PATCH] Process all systemd services through the systemd scriptlets This patch ensures that all systemd services are processed through the systemd scriptlets, so that services are properly configured per the preset file installed by the package. Without this, zfs.target is set, but none of the services are enabled per the preset file, meaning automounting filesystems and such won't work out of the box. Reviewed-by: Brian Behlendorf Signed-off-by: Neal Gompa Closes #5356 --- rpm/generic/zfs.spec.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in index 0975e9aba220..336ba0d0a4ba 100644 --- a/rpm/generic/zfs.spec.in +++ b/rpm/generic/zfs.spec.in @@ -40,6 +40,7 @@ # Generic enable switch for systemd %if %{with systemd} %define _systemd 1 +%define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target %endif # RHEL >= 7 comes with systemd @@ -241,7 +242,7 @@ find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \; %post %if 0%{?_systemd} -%systemd_post zfs.target +%systemd_post %{systemd_svcs} %else if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add zfs-import @@ -254,7 +255,7 @@ exit 0 %preun %if 0%{?_systemd} -%systemd_preun zfs.target +%systemd_preun %{systemd_svcs} %else if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del zfs-import @@ -267,7 +268,7 @@ exit 0 %postun %if 0%{?_systemd} -%systemd_postun zfs.target +%systemd_postun %{systemd_svcs} %endif %files