From a8b7cb67b667aa182d118264378c8b976363914e Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 2 Dec 2008 03:40:15 +0000 Subject: [PATCH] Fix initscript handling so codemux can be disabled. --- codemux.initscript | 10 +++++++++- codemux.spec | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/codemux.initscript b/codemux.initscript index de4f167..0bd5960 100644 --- a/codemux.initscript +++ b/codemux.initscript @@ -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 diff --git a/codemux.spec b/codemux.spec index d61582c..4e5cbfe 100644 --- a/codemux.spec +++ b/codemux.spec @@ -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 -- 2.43.0