From 835eb9298e83c32693ddcc66258fcdd6ffd3f980 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Thu, 13 Dec 2007 15:57:06 -0500 Subject: apply patch from Eli Criffield for running on Suse (fixing up spec and init-scripts to be suse compatible) --- init-scripts/certmaster | 39 +++++++++++++++++++++++++++++++++++---- init-scripts/funcd | 44 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 74 insertions(+), 9 deletions(-) (limited to 'init-scripts') diff --git a/init-scripts/certmaster b/init-scripts/certmaster index 11a4539..0e177a8 100755 --- a/init-scripts/certmaster +++ b/init-scripts/certmaster @@ -8,6 +8,8 @@ ### BEGIN INIT INFO # Provides: certmaster # Required-Start: network +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 # Short-Description: certificate master for Fedora Unified Network Control 'master server only' # Description: certificate master to sign/manage ca/cert infrastructure for func ### END INIT INFO @@ -22,18 +24,47 @@ # Sanity checks. [ -x /usr/bin/certmaster ] || exit 0 -# Source function library. -. /etc/rc.d/init.d/functions - SERVICE=certmaster PROCESS=certmaster +DAEMON=/usr/bin/certmaster CONFIG_ARGS=" " +CAStatus() +{ + ps wt? | grep "$DAEMON" 2>&1 > /dev/null + if [ "x$?" = "x0" ]; then + RVAL=0 + echo "certmaster is running" + else + RVAL=3 + echo "certmaster is not running" + fi +} + +if [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions + alias START_DAEMON=start_daemon + alias STATUS=CAStatus + alias LOG_SUCCESS=log_success_msg + alias LOG_FAILURE=log_failure_msg + alias LOG_WARNING=log_warning_msg +elif [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions + alias START_DAEMON=daemon + alias STATUS=status + alias LOG_SUCCESS=success + alias LOG_FAILURE=failure + alias LOG_WARNING=passed +else + echo "Error: your platform is not supported by $0" > /dev/stderr + exit 1 +fi + RETVAL=0 start() { echo -n $"Starting certmaster daemon: " - daemon --check $SERVICE $PROCESS --daemon $CONFIG_ARGS + START_DAEMON $PROCESS $CONFIG_ARGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE diff --git a/init-scripts/funcd b/init-scripts/funcd index 72e2de5..5a2d20d 100755 --- a/init-scripts/funcd +++ b/init-scripts/funcd @@ -7,7 +7,10 @@ ### BEGIN INIT INFO # Provides: funcd -# Required-Start: network, xinetd, httpd +# Required-Start: network +# Required-Stop: +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 # Short-Description: Fedora Unified Network Control # Description: Crazy simple, secure remote management. ### END INIT INFO @@ -22,18 +25,49 @@ # Sanity checks. [ -x /usr/bin/funcd ] || exit 0 -# Source function library. -. /etc/rc.d/init.d/functions - SERVICE=funcd PROCESS=funcd +DAEMON=/usr/bin/funcd CONFIG_ARGS=" " + +FuncStatus() +{ + ps wt? | grep "$DAEMON" 2>&1 > /dev/null + if [ "x$?" = "x0" ]; then + RVAL=0 + echo "$DAEMON is running" + else + RVAL=3 + echo "$DAEMON is not running" + fi +} + +if [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions + alias START_DAEMON=start_daemon + alias STATUS=FuncStatus + alias LOG_SUCCESS=log_success_msg + alias LOG_FAILURE=log_failure_msg + alias LOG_WARNING=log_warning_msg +elif [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions + alias START_DAEMON=daemon + alias STATUS=status + alias LOG_SUCCESS=success + alias LOG_FAILURE=failure + alias LOG_WARNING=passed +else + echo "Error: your platform is not supported by $0" > /dev/stderr + exit 1 +fi + + RETVAL=0 start() { echo -n $"Starting func daemon: " - daemon --check $SERVICE $PROCESS --daemon $CONFIG_ARGS + START_DAEMON $PROCESS $CONFIG_ARGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE -- cgit