Keep Linux Standard Base Compatibility on SuSE Linux

This commit is contained in:
Akihiro Uchida 2014-09-10 23:48:56 +09:00
parent 1f3bfe115c
commit 84485d8f85
2 changed files with 12 additions and 14 deletions

View File

@ -65,7 +65,7 @@ function pidof_pandora () {
if [ ! -f $PANDORA_DAEMON ] if [ ! -f $PANDORA_DAEMON ]
then then
echo "Pandora FMS Server not found, please check setup and read manual" echo "Pandora FMS Server not found, please check setup and read manual"
rc_status -s rc_failed 5 # program is not installed
rc_exit rc_exit
fi fi
@ -74,9 +74,8 @@ case "$1" in
PANDORA_PID=`pidof_pandora` PANDORA_PID=`pidof_pandora`
if [ ! -z "$PANDORA_PID" ] if [ ! -z "$PANDORA_PID" ]
then then
echo "Pandora FMS Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..." echo "Pandora FMS Server is currently running on this machine with PID ($PANDORA_PID)."
rc_failed 1 rc_exit # running start on a service already running
rc_exit
fi fi
$PANDORA_DAEMON $PANDORA_HOME -D $PANDORA_DAEMON $PANDORA_HOME -D
@ -91,7 +90,7 @@ case "$1" in
else else
echo "Cannot start Pandora FMS Server. Aborted." echo "Cannot start Pandora FMS Server. Aborted."
echo "Check Pandora FMS log files at '/var/log/pandora/pandora_server.error & pandora_server.log'" echo "Check Pandora FMS log files at '/var/log/pandora/pandora_server.error & pandora_server.log'"
rc_status -s rc_failed 7 # program is not running
fi fi
;; ;;
@ -100,7 +99,7 @@ case "$1" in
if [ -z "$PANDORA_PID" ] if [ -z "$PANDORA_PID" ]
then then
echo "Pandora FMS Server is not running, cannot stop it." echo "Pandora FMS Server is not running, cannot stop it."
rc_failed rc_exit # running stop on a service already stopped or not running
else else
echo "Stopping Pandora FMS Server" echo "Stopping Pandora FMS Server"
kill $PANDORA_PID > /dev/null 2>&1 kill $PANDORA_PID > /dev/null 2>&1
@ -131,7 +130,7 @@ case "$1" in
if [ -z "$PANDORA_PID" ] if [ -z "$PANDORA_PID" ]
then then
echo "Pandora FMS Server is not running." echo "Pandora FMS Server is not running."
rc_status rc_failed 7 # program is not running
else else
echo "Pandora FMS Server is running with PID $PANDORA_PID." echo "Pandora FMS Server is running with PID $PANDORA_PID."
rc_status rc_status

View File

@ -77,7 +77,7 @@ esac
if [ ! -f "${TENTACLE_PATH}$TENTACLE_DAEMON" ]; then if [ ! -f "${TENTACLE_PATH}$TENTACLE_DAEMON" ]; then
echo "Tentacle Server not found in ${TENTACLE_PATH}$TENTACLE_DAEMON" echo "Tentacle Server not found in ${TENTACLE_PATH}$TENTACLE_DAEMON"
rc_failed 1 rc_failed 5 # program is not installed
rc_exit rc_exit
fi fi
@ -86,8 +86,7 @@ case "$1" in
TENTACLE_PID=`get_pid` TENTACLE_PID=`get_pid`
if [ ! -z "$TENTACLE_PID" ]; then if [ ! -z "$TENTACLE_PID" ]; then
echo "Tentacle Server is already running with PID $TENTACLE_PID" echo "Tentacle Server is already running with PID $TENTACLE_PID"
rc_failed 2 rc_exit # running start on a service already running
rc_exit
fi fi
sudo -u $TENTACLE_USER ${TENTACLE_PATH}$TENTACLE_DAEMON $TENTACLE_OPTS sudo -u $TENTACLE_USER ${TENTACLE_PATH}$TENTACLE_DAEMON $TENTACLE_OPTS
@ -100,7 +99,7 @@ case "$1" in
else else
echo "Tentacle Server could not be started." echo "Tentacle Server could not be started."
echo "Verify that port $TENTACLE_PORT is not used." echo "Verify that port $TENTACLE_PORT is not used."
rc_status -v rc_failed 7 # program not running
fi fi
;; ;;
@ -109,7 +108,7 @@ case "$1" in
TENTACLE_PID=`get_pid` TENTACLE_PID=`get_pid`
if [ -z "$TENTACLE_PID" ]; then if [ -z "$TENTACLE_PID" ]; then
echo "Tentacle Server does not seem to be running" echo "Tentacle Server does not seem to be running"
rc_failed 2 rc_exit # running stop on a service already stopped or not running
else else
kill $TENTACLE_PID kill $TENTACLE_PID
sleep 1 sleep 1
@ -117,7 +116,7 @@ case "$1" in
if [ "$_PID" = "$TENTACLE_PID" ]; then if [ "$_PID" = "$TENTACLE_PID" ]; then
echo "Tentacle Server could not be stopped" echo "Tentacle Server could not be stopped"
rc_status -s rc_failed
fi fi
echo "Stopping Tentacle Server" echo "Stopping Tentacle Server"
@ -137,7 +136,7 @@ case "$1" in
TENTACLE_PID=`get_pid` TENTACLE_PID=`get_pid`
if [ -z "$TENTACLE_PID" ]; then if [ -z "$TENTACLE_PID" ]; then
echo "Tentacle Server is not running." echo "Tentacle Server is not running."
rc_status rc_failed 7 # program is not running
else else
echo "Tentacle Server is running with PID $TENTACLE_PID." echo "Tentacle Server is running with PID $TENTACLE_PID."
rc_status rc_status