OSDN Git Service

bash4.x に対応
author6638678 <6638678@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Fri, 4 Jun 2010 04:42:01 +0000 (04:42 +0000)
committer6638678 <6638678@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Fri, 4 Jun 2010 04:42:01 +0000 (04:42 +0000)
return -1 => return 255

git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10086 1ed66053-1c2d-0410-8867-f7571e6e31d3

l7vsd/init.d/l7vsd

index b3ca0c2..e00b8ec 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh
 # Start/Stop script for l7vsd
 #
 # chkconfig: - 95 34
@@ -23,8 +23,8 @@ start() {
        PROCS=`ps ax | grep $DAEMON | grep -v grep | wc -l`
        if [ $PROCS -ne 0 ]; then
            echo "$PROG is running."
-           RETVAL=-1
-           return
+           RETVAL=255
+           return $RETVAL
        fi
        cleanup
     fi
@@ -49,9 +49,9 @@ stop() {
     PID=`pidof l7vsd`
     if [ -z $PID ]; then
        echo "$PROG is not running."
-       RETVAL=-1
+       RETVAL=255
        cleanup
-       return
+       return $RETVAL
     fi
 
     echo -n "Stopping $PROG: "
@@ -69,7 +69,7 @@ stop() {
 status() {
     if [ ! -e $PIDFILE ]; then
        echo "$PROG is not running."
-       RETVAL=-1
+       RETVAL=255
     else
        echo -n "$PROG running with pid: "
        cat $PIDFILE
@@ -88,7 +88,8 @@ cleanup() {
 # Prefer for Running script
 if [ ! -x $DAEMON ]; then
     echo "$DAEMON does not exist!"
-    exit -1
+    RETVAL=255
+    exit $RETVAL
 fi
 
 case "$1" in
@@ -118,7 +119,7 @@ case "$1" in
     
     *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
-       RETVAL=-1
+       RETVAL=255
 
 esac