From 2aa47cbf9968ec47847d774f8958253b7ceaded6 Mon Sep 17 00:00:00 2001 From: John Morris Date: Mon, 3 Sep 2012 13:16:34 -0500 Subject: redhat init scripts: Update to be more like the debian scripts Fixing this script for RedHat; its advantage over the Debian script is the dependency on lsb drags in quite a number of extra, otherwise- unneeded packages. - Remove agent functions from bcfg2.init - Add success || failure messages - Include options from /etc/sysconfig/bcfg2* - Other snippets from debian script (cherry picked from commit 4034d6e503f1543223355f7aceb6aefd933fabb3) Signed-off-by: Sol Jerome --- redhat/scripts/bcfg2-server.init | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'redhat/scripts/bcfg2-server.init') diff --git a/redhat/scripts/bcfg2-server.init b/redhat/scripts/bcfg2-server.init index 000cc0095..ebeda04bb 100755 --- a/redhat/scripts/bcfg2-server.init +++ b/redhat/scripts/bcfg2-server.init @@ -14,6 +14,10 @@ PARAMS="-D $PIDFILE" prog=$(basename $DAEMON) conf="/etc/bcfg2.conf" +# Disabled per default +BCFG2_SERVER_OPTIONS="" +BCFG2_SERVER_ENABLED=0 + PATH=/sbin:/bin:/usr/bin:/usr/sbin # Source function library @@ -22,13 +26,19 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin # Include default startup configuration if exists test -f /etc/sysconfig/$prog && . /etc/sysconfig/$prog +if [ "$BCFG2_SERVER_ENABLED" -eq 0 ] ; then + failure $"bcfg2-server is disabled - see /etc/sysconfig/bcfg2-server" + echo + exit 0 +fi + RETVAL=0 start () { test -x $DAEMON || exit 5 test -f $conf || exit 6 echo -n $"Starting $prog: " - daemon $DAEMON ${PARAMS} + daemon $DAEMON ${PARAMS} ${BCFG2_SERVER_OPTIONS} && success || failure RETVAL=$? echo if test $RETVAL = 0 ; then @@ -39,7 +49,7 @@ start () { stop () { echo -n $"Stopping $prog: " - killproc ${prog} + killproc ${prog} && success || failure RETVAL=$? echo rm -f /var/lock/subsys/$prog -- cgit v1.2.3-1-g7c22