]> git.pld-linux.org Git - packages/net-snmp.git/commitdiff
initial
authorArtur Frysiak <artur@frysiak.net>
Thu, 13 Feb 2003 12:47:58 +0000 (12:47 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    net-snmpd.init -> 1.1
    net-snmpd.sysconfig -> 1.1
    net-snmptrapd.init -> 1.1
    net-snmptrapd.sysconfig -> 1.1

net-snmpd.init [new file with mode: 0644]
net-snmpd.sysconfig [new file with mode: 0644]
net-snmptrapd.init [new file with mode: 0644]
net-snmptrapd.sysconfig [new file with mode: 0644]

diff --git a/net-snmpd.init b/net-snmpd.init
new file mode 100644 (file)
index 0000000..7bdf320
--- /dev/null
@@ -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
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd
+       else
+               msg_already_running "snmpd"
+               RETVAL=1
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/snmpd ]; then
+               msg_stopping "snmpd"
+               killproc snmpd
+               rm -f /var/lock/subsys/snmpd >/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 (file)
index 0000000..c281246
--- /dev/null
@@ -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 (file)
index 0000000..61a036a
--- /dev/null
@@ -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 (file)
index 0000000..4947e7e
--- /dev/null
@@ -0,0 +1,4 @@
+# Customized setings for snmpd
+
+# Define nice level for snmpd
+SERVICE_RUN_NICE_LEVEL="+0"
This page took 0.157341 seconds and 4 git commands to generate.