- support non-RH distros by checking for /sbin/chkconfig before using
authorMark Huang <mlhuang@cs.princeton.edu>
Thu, 6 Jul 2006 17:44:45 +0000 (17:44 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Thu, 6 Jul 2006 17:44:45 +0000 (17:44 +0000)
myplc.spec

index c236416..42203b7 100644 (file)
@@ -73,15 +73,19 @@ if [ -x %{_sysconfdir}/init.d/plc ] ; then
 fi
 
 %post
-chkconfig --add plc
-chkconfig plc on
+if [ -x /sbin/chkconfig ] ; then
+    /sbin/chkconfig --add plc
+    /sbin/chkconfig plc on
+fi
 
 %preun
 # 0 = erase, 1 = upgrade
 if [ $1 -eq 0 ] ; then
-    service plc stop
-    chkconfig plc off
-    chkconfig --del plc
+    %{_sysconfdir}/init.d/plc stop
+    if [ -x /sbin/chkconfig ] ; then
+        /sbin/chkconfig plc off
+       /sbin/chkconfig --del plc
+    fi
 fi
 
 %files