From: Brian Behlendorf Date: Wed, 3 Jul 2013 23:12:37 +0000 (-0700) Subject: Add conditional chkconfig to packaging X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=zfs.git;a=commitdiff_plain;h=ba661a6e3f118fbf66ac11dafbe4cb7ac3fa51bd 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 Closes #1376 --- diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in index 8b57e6e..77f217d 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