commit 15c1ee1f141062e6cf6bb07666982e5fee5d34fe Author: kueller Date: Mon Jan 3 10:48:06 2011 +0000 Neue Version V963 git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_ucd-snmp@5933 504e572c-2e33-0410-9681-be2bf7408885 diff --git a/etc/init.d/snmpd b/etc/init.d/snmpd new file mode 100644 index 0000000..716037c --- /dev/null +++ b/etc/init.d/snmpd @@ -0,0 +1,62 @@ +#!/bin/sh +#init script fuer ucd-snmp +#Script Framework - Automatisiertes Erzeugen der Monsum Linux Distribution +#(c) Rainmaker MultiMedia OHG +# +#$Author$ +#$Date$ +#$Revision$ +# +#$Log$ +#Revision 1.3 2007/03/12 22:19:29 segler +#configfile cause added, sleep corrected +# +#Revision 1.2 2003/02/01 18:17:19 kueller +#Korrektur beim start von snmptrapd - Echo Ausgabe korrigiert (nicht tramp, +#sondern trap), Option -s (Syslog benutzen) hinzugefügt +# +#Revision 1.1.1.1 2002/01/11 19:58:10 kueller +#New AddOns fuer ucd-snmpd +# +# + +source /etc/init.d/functions + +case "$1" in + start) + if [ -f /etc/snmpd/snmpd.conf ]; then + echo -n "Starting ucd-snmp daemon" + /usr/sbin/snmpd -c /etc/snmpd/snmpd.conf + evaluate_retval + else + echo "Cannot start ucd-snmp daemon. /etc/snmpd/snmpd.conf does not exist. Try snmpconf" + fi + + if [ -f /etc/snmpd/snmptrapd.conf ]; then + echo -n "Starting ucd-snmptrap deamon" + loadproc /usr/sbin/snmptrapd -s -c /etc/snmpd/snmptrapd.conf + else + echo "Cannot start ucd-snmptrap daemon. /etc/snmpd/snmptrapd.conf does not exist. Try snmpconf" + fi + ;; + + stop) + echo -n "Stopping ucd-snmp daemon" + pkill -f /usr/sbin/snmpd + evaluate_retval + echo -n "Stopping ucd-snmptramp daemon" + pkill -f /usr/sbin/snmptrapd + evaluate_retval + ;; + restart) + $0 stop + /bin/sleep 1 + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; + +esac diff --git a/etc/init/snmpd.conf b/etc/init/snmpd.conf new file mode 100644 index 0000000..327d640 --- /dev/null +++ b/etc/init/snmpd.conf @@ -0,0 +1,15 @@ +description "Simple net managemant Protokoll Deamon" +author "Harald Kueller " +version 1.0 +emits none special + +start on (runlevel [2345] and (started ifup)) +stop on runlevel [016] + +console none + +script + if [ -f /etc/snmpd/snmpd.conf ]; then + /usr/sbin/snmpd -c /etc/snmpd/snmpd.conf -f + fi +end script diff --git a/init/genpkg b/init/genpkg new file mode 100644 index 0000000..693bf78 --- /dev/null +++ b/init/genpkg @@ -0,0 +1,31 @@ +#!/bin/bash +#genpkg script für ucd-snmpd +#(c) Rainmaker MultiMedia OHG +# +#$Author$ +#$Date$ +#$Revision$ +# +#$Log$ +#Revision 1.1 2002/01/11 19:58:10 kueller +#Initial revision +# +# + +if [ -d /var/install/sysvinit ]; then + WDIR=`pwd` + cd etc/init.d + chmod 755 cups + mkdir rc{0,1,2,3,4,5,6}.d + for i in 0 1 2 6; do + cd rc$i.d + ln -s ../snmpd K05snmpd + cd .. + done + for i in 3 4 5; do + cd rc$i.d + ln -s ../snmpd S60snmpd + cd .. + done + cd $WDIR +fi