From 383a15b58bffd559d3124e898b774f40f8a799f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 20 Apr 2009 05:48:53 +0000 Subject: [PATCH] - fix encoding - simplify the service checks Changed files: net-snmpd.init -> 1.21 --- net-snmpd.init | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/net-snmpd.init b/net-snmpd.init index 8b7f7b9..1200170 100644 --- a/net-snmpd.init +++ b/net-snmpd.init @@ -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 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 -- 2.44.0