From: Fajar A. Nugraha Date: Thu, 7 Jul 2011 07:25:53 +0000 (+0700) Subject: Remove zfs service only on uninstall, not on upgrade X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=1fa3bb750d0418dc4a5a3abd2bd8cce9c205c9e1;p=zfs.git Remove zfs service only on uninstall, not on upgrade This caused problems on upgrade using RPM: * The new version will run chkconfig --add, which has no effect since the service was already added. * The old version will run chkconfig --del, which caused zfs service removal. Only run "chkconfig --del" on complete uninstall, by checking the value of "$1" to %preun, which will be "0" on uninstall, and "1" on upgrade. http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html Signed-off-by: Brian Behlendorf Closes #314 --- diff --git a/zfs.spec.in b/zfs.spec.in index 3a57fd8..cba98af 100644 --- a/zfs.spec.in +++ b/zfs.spec.in @@ -100,5 +100,5 @@ rm -rf $RPM_BUILD_ROOT exit 0 %preun -[ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs +[ "$1" = 0 ] && [ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs exit 0