SOURCES: net-snmpd.init - fix encoding - simplify the service checks
glen
glen at pld-linux.org
Mon Apr 20 07:48:58 CEST 2009
Author: glen Date: Mon Apr 20 05:48:58 2009 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- fix encoding
- simplify the service checks
---- Files affected:
SOURCES:
net-snmpd.init (1.20 -> 1.21)
---- Diffs:
================================================================
Index: SOURCES/net-snmpd.init
diff -u SOURCES/net-snmpd.init:1.20 SOURCES/net-snmpd.init:1.21
--- SOURCES/net-snmpd.init:1.20 Mon Apr 20 01:20:43 2009
+++ SOURCES/net-snmpd.init Mon Apr 20 07:48:53 2009
@@ -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 @@
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
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/net-snmpd.init?r1=1.20&r2=1.21&f=u
More information about the pld-cvs-commit
mailing list