summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Bielawa <timbielawa@gmail.com>2008-12-15 14:00:37 -0500
committerAdrian Likins <alikins@redhat.com>2008-12-15 14:00:37 -0500
commit8092325418f916bf744437c3c42acf4d22ca0a61 (patch)
treed4bd9392798d2eb8e1175b9054ac7cfd1d863bfd
parentca8dd9b8ac04f18b550225a9cbbd927b1dc61794 (diff)
downloadcertmaster-8092325418f916bf744437c3c42acf4d22ca0a61.zip
certmaster-8092325418f916bf744437c3c42acf4d22ca0a61.tar.gz
certmaster-8092325418f916bf744437c3c42acf4d22ca0a61.tar.xz
Patch from Tim Bielawa <timbielawa@gmail.com> to make init scripts work
on debian/ubuntu
-rwxr-xr-xinit-scripts/certmaster42
1 files changed, 29 insertions, 13 deletions
diff --git a/init-scripts/certmaster b/init-scripts/certmaster
index 95c16fc..6cfe4c2 100755
--- a/init-scripts/certmaster
+++ b/init-scripts/certmaster
@@ -63,22 +63,38 @@ fi
RETVAL=0
start() {
- echo -n $"Starting certmaster daemon: "
- START_DAEMON $PROCESS $CONFIG_ARGS
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
- return $RETVAL
+ if [ -f /etc/debian_version ]; then
+ log_begin_msg "Starting certmaster daemon: "
+ start-stop-daemon --exec $DAEMON --start --quiet -- $CONFIG_ARGS > /dev/null
+ RETVAL=$?
+ log_end_msg $RETVAL
+ return $RETVAL
+ else
+ echo -n $"Starting certmaster daemon: "
+ START_DAEMON $PROCESS $CONFIG_ARGS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
+ return $RETVAL
+ fi
}
stop() {
- echo -n $"Stopping certmaster daemon: "
- killproc $PROCESS
- RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f /var/lock/subsys/$SERVICE
- rm -f /var/run/$SERVICE.pid
+ if [ -f /etc/debian_version ]; then
+ log_daemon_msg "Stopping certmaster daemon" "certmaster"
+ start-stop-daemon --stop --quiet --pidfile /var/run/certmaster.pid --name certmaster
+ RETVAL=$?
+ log_end_msg $RETVAL
+ rm -f /var/run/certmaster.pid
+ else
+ echo -n $"Stopping certmaster daemon: "
+ killproc $PROCESS
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f /var/lock/subsys/$SERVICE
+ rm -f /var/run/$SERVICE.pid
+ fi
fi
}