SHA256
1
0
forked from pool/net-snmp

Accepting request 183515 from net-snmp:factory

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/183515
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/net-snmp?expand=0&rev=65
This commit is contained in:
Stephan Kulow 2013-07-18 14:07:01 +00:00 committed by Git OBS Bridge
parent 2f8fce6dd6
commit 2637d7fe62
3 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jul 10 08:26:14 UTC 2013 - lars@linux-schulserver.de
- improve snmptrapd init script (avoid to overwrite the logfile
on restart)
-------------------------------------------------------------------
Mon May 20 11:22:24 UTC 2013 - lchiquitto@suse.com

View File

@ -7,6 +7,7 @@
notifempty
missingok
create 600 root root
su root root
sharedscripts
postrotate
/etc/init.d/snmpd reload ||:

View File

@ -20,7 +20,9 @@ SNMPTRAPD_CONF="/etc/snmp/snmptrapd.conf"
SNMPTRAPD_LOGFILE="/var/log/net-snmpd.log"
SNMPTRAPD_PID="/var/run/snmptrapd.pid"
test -x $SNMPTRAPD || exit 5
test -x $SNMPTRAPD || { echo "$SNMPTRAPD not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
SNMPD_CONFIG=/etc/sysconfig/net-snmp
@ -67,13 +69,18 @@ fi
SNMPTRAPD_LOGFILE="${SNMPTRAPD_LOGFILE:-/var/log/net-snmpd.log}"
case "$1" in
start)
echo -n "Starting snmptrapd:"
echo -n "Starting snmptrapd: "
startproc $SNMPTRAPD $SNMPTRAPD_CONF -A -LF ${SNMPD_LOGLEVEL:-n} $SNMPTRAPD_LOGFILE -p $SNMPTRAPD_PID
rc_status -v
;;
stop)
echo -n "Shutting down snmptrapd:"
echo -n "Shutting down snmptrapd: "
killproc -TERM $SNMPTRAPD
if [ -f "$SNMPTAPDD_LOGFILE" ]; then
DATE=$(date +"%Y%m%d")
/bin/mv "$SNMPTAPDD_LOGFILE" "$SNMPTAPDD_LOGFILE-$DATE"
test -x /usr/bin/bzip2 && /usr/bin/bzip2 "$SNMPTAPDD_LOGFILE-$DATE"
fi
rc_status -v
;;
try-restart)
@ -86,17 +93,17 @@ case "$1" in
rc_status
;;
force-reload)
echo -n "Reload service snmptrapd:"
echo -n "Reload service snmptrapd: "
killproc -HUP $SNMPTRAPD
rc_status -v
;;
reload)
echo -n "Reload service snmptrapd:"
echo -n "Reload service snmptrapd: "
killproc -HUP $SNMPTRAPD
rc_status -v
;;
status)
echo -n "Checking for service snmptrapd:"
echo -n "Checking for service snmptrapd: "
checkproc $SNMPTRAPD
rc_status -v
;;