- updated
authorankry <ankry@pld-linux.org>
Fri, 2 May 2003 23:38:06 +0000 (23:38 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    atsar.init -> 1.3

atsar.init

index 58975e7..0043770 100755 (executable)
@@ -23,25 +23,35 @@ RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       # Run atsadc.
-       msg_starting "atsar"
-       daemon /usr/bin/atsadc /var/log/atsar/atsa`date +%d`
-       RETVAL=$?
-        rm -f /var/log/atsar/ftpstat  2> /dev/null
-        rm -f /var/log/atsar/httpstat 2> /dev/null
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/atsar ]; then
+               # Run atsadc.
+               msg_starting atsar
+               daemon /usr/bin/atsadc /var/log/atsar/atsa`date +%d`
+               RETVAL=$?
+               rm -f /var/log/atsar/ftpstat  2> /dev/null
+               rm -f /var/log/atsar/httpstat 2> /dev/null
 
-       if [ -f /etc/atsar.conf ]
-       then
-               /usr/bin/atsaftp
-               /usr/bin/atsahttp
+               if [ -f /etc/atsar.conf ]; then
+                       /usr/bin/atsaftp
+                       /usr/bin/atsahttp
+               fi
+               echo
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atsar
+       else
+               msg_already_running atsar
+               exit 1
        fi
-       echo
-       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atsar
        ;;
   stop)
-       msg_stopping "atsar"
-       daemon  rm -f /var/lock/subsys/atsar
-       RETVAL=$?
+       if [ -f /var/lock/subsys/atsar ]; then
+               msg_stopping atsar
+               daemon  rm -f /var/lock/subsys/atsar
+               RETVAL=$?
+       else
+               msg_not_running atsar
+               exit 1
+       fi
        ;;
   status)
        ;;
@@ -54,7 +64,7 @@ case "$1" in
        $0 start
        ;;
   *)
-       echo "Usage: $0 {start|stop|status|reload|restart}"
+       msg_usage "$0 {start|stoprestart|reload|status}"
        exit 1
 esac
 
This page took 0.062111 seconds and 4 git commands to generate.