Skip to content

Commit

Permalink
Process all systemd services through the systemd scriptlets
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Neal Gompa <[email protected]>
Closes openzfs#5356
  • Loading branch information
Conan-Kudo authored and behlendorf committed Feb 2, 2017
1 parent b6398c1 commit e4903b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rpm/generic/zfs.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -267,7 +268,7 @@ exit 0

%postun
%if 0%{?_systemd}
%systemd_postun zfs.target
%systemd_postun %{systemd_svcs}
%endif

%files
Expand Down

0 comments on commit e4903b2

Please sign in to comment.