diff options
author | Adrian Likins <alikins@grimlock.devel.redhat.com> | 2007-12-13 15:57:06 -0500 |
---|---|---|
committer | Adrian Likins <alikins@grimlock.devel.redhat.com> | 2007-12-13 15:57:06 -0500 |
commit | 835eb9298e83c32693ddcc66258fcdd6ffd3f980 (patch) | |
tree | be6d6df45102bd35dff85e2f09283769d42f9893 /init-scripts/funcd | |
parent | 9aa702e1b83bc682597a11fddb394ee87c9cdfa0 (diff) | |
download | func-835eb9298e83c32693ddcc66258fcdd6ffd3f980.tar.gz func-835eb9298e83c32693ddcc66258fcdd6ffd3f980.tar.xz func-835eb9298e83c32693ddcc66258fcdd6ffd3f980.zip |
apply patch from Eli Criffield <elicriffield@gmail.com> for
running on Suse
(fixing up spec and init-scripts to be suse compatible)
Diffstat (limited to 'init-scripts/funcd')
-rwxr-xr-x | init-scripts/funcd | 44 |
1 files changed, 39 insertions, 5 deletions
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 |