aboutsummaryrefslogtreecommitdiffstats
path: root/rpm/generic
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2013-07-03 16:12:37 -0700
committerBrian Behlendorf <behlendorf1@llnl.gov>2013-07-03 16:44:24 -0700
commitba661a6e3f118fbf66ac11dafbe4cb7ac3fa51bd (patch)
tree7077b8ca4d8940ea6db7b2688ac0885faec2bb73 /rpm/generic
parente9832eb2721ce1695fa8bdaa908cdde9690f95df (diff)
Add conditional chkconfig to packaging
Prior to adopting the kmod style packaging the zfs packages would conditionally invoke /sbin/chkconfig to create the proper links for the init script. This is done conditionally because many distributions are moving away from SysV style init scripts and we don't want to cause errors on those. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1376
Diffstat (limited to 'rpm/generic')
-rw-r--r--rpm/generic/zfs.spec.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
index 8b57e6e72..77f217dbe 100644
--- a/rpm/generic/zfs.spec.in
+++ b/rpm/generic/zfs.spec.in
@@ -113,7 +113,14 @@ make %{?_smp_mflags}
make install DESTDIR=%{?buildroot}
find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+[ -x /sbin/chkconfig ] && /sbin/chkconfig --add zfs
+
+%preun
+if [ $1 -eq 0 ] ; then
+ [ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs
+fi
%postun -p /sbin/ldconfig