]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Remove zfs service only on uninstall, not on upgrade
authorFajar A. Nugraha <github@fajar.net>
Thu, 7 Jul 2011 07:25:53 +0000 (14:25 +0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 8 Jul 2011 18:44:17 +0000 (11:44 -0700)
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 <behlendorf1@llnl.gov>
Closes #314

zfs.spec.in

index 3a57fd8773640fd0d2363fa3afe8be6b0c9b71fb..cba98af1d77b5e3be547fbd37932c39d76f3ce81 100644 (file)
@@ -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