]> git.pld-linux.org Git - packages/net-snmp.git/commitdiff
- fix encoding
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 20 Apr 2009 05:48:53 +0000 (05:48 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- simplify the service checks

Changed files:
    net-snmpd.init -> 1.21

net-snmpd.init

index 8b7f7b93d84987c85dfd04627969995a6f971d88..1200170212dbb0705f9df0ca5b0a4e7bd9d586d4 100644 (file)
@@ -5,16 +5,15 @@
 # chkconfig:           345 50 50
 #
 # description:         Simple Network Management Protocol (SNMP) Daemon
-# description(es):     Servidor SNMP (Simple Network Management Protocol)
-# description(pt_BR):  Servidor SNMP (Simple Network Management Protocol)
-# description(ru):     äĹÍĎΠSNMP (Simple Network Management Protocol)
-# description(uk):     äĹÍĎΠSNMP (Simple Network Management Protocol)
+# description(es.UTF-8):       Servidor SNMP (Simple Network Management Protocol)
+# description(pt_BR.UTF-8):    Servidor SNMP (Simple Network Management Protocol)
+# description(ru.UTF-8):       Демон SNMP (Simple Network Management Protocol)
+# description(uk.UTF-8):       Демон SNMP (Simple Network Management Protocol)
 #
 # processname:         snmpd
 # config:              /etc/snmp/snmpd.local.conf
 # config:              /etc/snmp/snmpd.conf
 
-
 # Source function library
 . /etc/rc.d/init.d/functions
 
@@ -40,37 +39,40 @@ fi
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/snmpd ]; then
-               msg_starting "snmpd"
-               daemon /usr/bin/setsid /usr/sbin/snmpd \
-                       $([ -n "$CONF_FILE" ] && echo "-C -c $CONF_FILE") \
-                       $(is_yes "$LOG_WARNINGS_MESSAGES_TO_SYSLOG" && echo "-LSid" ) \
-                       -p /var/run/snmpd.pid $SNMPD_LISTEN_ADDRS </dev/null
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd
-       else
+       if [ -f /var/lock/subsys/snmpd ]; then
                msg_already_running "snmpd"
+               return
        fi
+
+       msg_starting "snmpd"
+       daemon /usr/bin/setsid /usr/sbin/snmpd \
+               $([ -n "$CONF_FILE" ] && echo "-C -c $CONF_FILE") \
+               $(is_yes "$LOG_WARNINGS_MESSAGES_TO_SYSLOG" && echo "-LSid" ) \
+               -p /var/run/snmpd.pid $SNMPD_LISTEN_ADDRS </dev/null
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd
 }
 
 stop() {
-       if [ -f /var/lock/subsys/snmpd ]; then
-               msg_stopping "snmpd"
-               killproc snmpd
-               rm -f /var/lock/subsys/snmpd >/dev/null 2>&1
-       else
+       if [ ! -f /var/lock/subsys/snmpd ]; then
                msg_not_running "snmpd"
+               return
        fi
+
+       msg_stopping "snmpd"
+       killproc snmpd
+       rm -f /var/lock/subsys/snmpd >/dev/null 2>&1
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/snmpd ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/snmpd ]; then
                msg_not_running "snmpd"
                RETVAL=$1
+               return
        fi
+
+       stop
+       start
 }
 
 RETVAL=0
This page took 0.710352 seconds and 4 git commands to generate.