Fix initscript handling so codemux can be disabled.
Daniel Hokka Zakrisson [Tue, 2 Dec 2008 03:40:15 +0000 (03:40 +0000)]
codemux.initscript
codemux.spec

index de4f167..0bd5960 100644 (file)
@@ -65,8 +65,16 @@ case "$1" in
             echo 'not running' && exit 1
         ;;
 
+    condrestart)
+       if test -f /var/lock/subsys/$PROC; then
+           $0 stop
+           $0 start
+           RETVAL=$?
+       fi
+       ;;
+
     *)
-        echo "Usage: $0 {start|stop|restart|status}"
+        echo "Usage: $0 {start|stop|restart|status|condrestart}"
         RETVAL=1
 esac
 
index d61582c..4e5cbfe 100644 (file)
@@ -47,15 +47,15 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(0644,root,root)
 %attr(0755,root,root) %{_initrddir}/codemux
-%config /etc/codemux/codemux.conf
+%config(noreplace) /etc/codemux/codemux.conf
 %attr(0755,root,root) /usr/sbin/codemux
 %{_sysconfdir}/logrotate.d/codemux
 
 %post
-chkconfig codemux reset
+chkconfig --add codemux
 
 if [ -z "$PL_BOOTCD" ]; then
-    /etc/init.d/codemux restart
+    /etc/init.d/codemux condrestart
 fi
 
 %preun