From: Artur Frysiak Date: Thu, 13 Feb 2003 12:47:58 +0000 (+0000) Subject: initial X-Git-Tag: auto/ac/net-snmp-5_0_8-0_6~27 X-Git-Url: https://git.pld-linux.org/?a=commitdiff_plain;h=43f17c647976a97cd577137b3414d9ff762ae28d;p=packages%2Fnet-snmp.git initial Changed files: net-snmpd.init -> 1.1 net-snmpd.sysconfig -> 1.1 net-snmptrapd.init -> 1.1 net-snmptrapd.sysconfig -> 1.1 --- diff --git a/net-snmpd.init b/net-snmpd.init new file mode 100644 index 0000000..7bdf320 --- /dev/null +++ b/net-snmpd.init @@ -0,0 +1,76 @@ +#!/bin/sh +# +# snmpd Simple Network Management Protocol (SNMP) Daemon +# +# 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) +# +# processname: snmpd +# config: /etc/snmp/snmpd.local.conf +# config: /etc/snmp/snmpd.conf + + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +CONF_FILE=/etc/snmp/snmpd.conf +LOG_WARNINGS_MESSAGES_TO_SYSLOG=yes + +# Get service config +[ -f /etc/sysconfig/snmpd ] && . /etc/sysconfig/snmpd + +# Check that networking is up. +if is_no "${NETWORKING}"; then + msg_network_down "snmpd" + exit 1 +fi + +# See how we were called. +case "$1" in + 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 "-s" ) /dev/null 2>&1 + else + msg_not_running "snmpd" + RETVAL=1 + fi + ;; + restart|reload) + $0 stop + $0 start + ;; + status) + status snmpd + exit $? + ;; + *) + msg_usage "$0 {start|stop|status|restart|reload}" + RETVAL=1 +esac + +exit $RETVAL diff --git a/net-snmpd.sysconfig b/net-snmpd.sysconfig new file mode 100644 index 0000000..c281246 --- /dev/null +++ b/net-snmpd.sysconfig @@ -0,0 +1,10 @@ +# Customized settings for snmpd + +# Define nice level for snmpd +SERVICE_RUN_NICE_LEVEL="+0" + +# Default configuration file name +CONF_FILE=/etc/snmp/snmpd.conf + +# Log warnings/messages to syslog (otherwise to /var/log/snmpd.log) +LOG_WARNINGS_MESSAGES_TO_SYSLOG=yes diff --git a/net-snmptrapd.init b/net-snmptrapd.init new file mode 100644 index 0000000..61a036a --- /dev/null +++ b/net-snmptrapd.init @@ -0,0 +1,66 @@ +#!/bin/sh +# +# ucd-snmptrapd Simple Network Management Protocol (SNMP) Trap Daemon +# +# chkconfig: 345 51 51 +# +# description: Simple Network Management Protocol (SNMP) Trap Daemon +# +# processname: snmptrapd +# config: /etc/snmp/snmptrapd.local.conf +# config: /etc/snmp/snmptrapd.conf + + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Get service config +[ -f /etc/sysconfig/snmpd ] && . /etc/sysconfig/snmptrapd + +# Check that networking is up. +if is_no "${NETWORKING}"; then + msg_network_down "snmptrapd" + exit 1 +fi + +# See how we were called. +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/snmptrapd ]; then + msg_starting "snmptrapd" + daemon /usr/sbin/snmptrapd + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmptrapd + else + msg_already_running "snmptrapd" + exit 1 + fi + ;; + stop) + if [ -f /var/lock/subsys/snmptrapd ]; then + msg_stopping "snmptrapd" + killproc snmptrapd + rm -f /var/lock/subsys/snmptrapd >/dev/null 2>&1 + else + msg_not_running "snmptrapd" + exit 1 + fi + ;; + restart|reload) + $0 stop + $0 start + ;; + status) + status snmptrapd + exit $? + ;; + *) + msg_usage "$0 {start|stop|status|restart|reload}" + exit 1 +esac + +exit $RETVAL diff --git a/net-snmptrapd.sysconfig b/net-snmptrapd.sysconfig new file mode 100644 index 0000000..4947e7e --- /dev/null +++ b/net-snmptrapd.sysconfig @@ -0,0 +1,4 @@ +# Customized setings for snmpd + +# Define nice level for snmpd +SERVICE_RUN_NICE_LEVEL="+0"