Remove initscript
This sort of reverts 26d074aba3172d7019a47ada003531b7b7f80584 whose commit message included the phrase, "This can go away after everything is upgraded to precise..." We're well past upgrading to Ubuntu Precise, as we're actively upgrading the last of our Precise servers to Trusty now. Further, the initscript we backported from Precise no longer works on Xenial which we're starting to get into production, and we haven't been installing this file on our RH-based platforms at all, so it's long overdue to be cleaned up. Change-Id: I3f99495142ad1b4352c1566889381fe5c92b2936
This commit is contained in:
parent
ca3b9f87cf
commit
2de225f933
102
files/snmpd.init
102
files/snmpd.init
@ -1,102 +0,0 @@
|
||||
#! /bin/sh -e
|
||||
### BEGIN INIT INFO
|
||||
# Provides: snmpd snmptrapd
|
||||
# Required-Start: $network $remote_fs $syslog
|
||||
# Required-Stop: $network $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: SNMP agents
|
||||
# Description: NET SNMP (Simple Network Management Protocol) Agents
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: Jochen Friedrich <jochen@scram.de>
|
||||
#
|
||||
set -e
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
|
||||
test -x /usr/sbin/snmpd || exit 0
|
||||
test -x /usr/sbin/snmptrapd || exit 0
|
||||
|
||||
# Defaults
|
||||
export MIBDIRS=/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
|
||||
SNMPDRUN=yes
|
||||
SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid'
|
||||
TRAPDRUN=no
|
||||
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
|
||||
|
||||
# Reads config file (will override defaults above)
|
||||
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
|
||||
|
||||
# Cd to / before starting any daemons.
|
||||
cd /
|
||||
|
||||
# Create compatibility link to old AgentX socket location
|
||||
if [ "$SNMPDCOMPAT" = "yes" ] && [ "$1" != status ]; then
|
||||
ln -sf /var/agentx/master /var/run/agentx
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting network management services:"
|
||||
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
|
||||
start-stop-daemon --quiet --start --oknodo --exec /usr/sbin/snmpd \
|
||||
-- $SNMPDOPTS
|
||||
log_progress_msg " snmpd"
|
||||
fi
|
||||
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then
|
||||
start-stop-daemon --quiet --start --oknodo --exec /usr/sbin/snmptrapd \
|
||||
-- $TRAPDOPTS
|
||||
log_progress_msg " snmptrapd"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping network management services:"
|
||||
start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmpd
|
||||
log_progress_msg " snmpd"
|
||||
start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmptrapd
|
||||
log_progress_msg " snmptrapd"
|
||||
;;
|
||||
restart)
|
||||
log_daemon_msg "Restarting network management services:"
|
||||
start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmpd
|
||||
start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmptrapd
|
||||
# Allow the daemons time to exit completely.
|
||||
sleep 2
|
||||
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
|
||||
start-stop-daemon --quiet --start --exec /usr/sbin/snmpd -- $SNMPDOPTS
|
||||
log_progress_msg " snmpd"
|
||||
fi
|
||||
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then
|
||||
# Allow snmpd time to start up.
|
||||
sleep 1
|
||||
start-stop-daemon --quiet --start --exec /usr/sbin/snmptrapd -- $TRAPDOPTS
|
||||
log_progress_msg " snmptrapd"
|
||||
fi
|
||||
;;
|
||||
reload|force-reload)
|
||||
log_daemon_msg "Reloading network management services:"
|
||||
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
|
||||
start-stop-daemon --quiet --stop --signal 1 \
|
||||
--pidfile /var/run/snmpd.pid --exec /usr/sbin/snmpd
|
||||
log_progress_msg " snmpd"
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
status=0
|
||||
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
|
||||
status_of_proc /usr/sbin/snmpd snmpd || status=$?
|
||||
fi
|
||||
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then
|
||||
status_of_proc /usr/sbin/snmptrapd snmptrapd || status=$?
|
||||
fi
|
||||
exit $status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/snmpd {start|stop|restart|reload|force-reload|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
@ -13,26 +13,6 @@ class snmpd {
|
||||
hasrestart => true,
|
||||
subscribe => File['/etc/snmp/snmpd.conf'],
|
||||
}
|
||||
|
||||
if ($::osfamily == 'Debian') {
|
||||
# This file is only needed on machines pre-precise. There is a bug in
|
||||
# the previous init script versions which causes them to attempt
|
||||
# snmptrapd even if it's configured not to run, and then to report
|
||||
# failure.
|
||||
file { '/etc/init.d/snmpd':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
source => 'puppet:///modules/snmpd/snmpd.init',
|
||||
replace => true,
|
||||
require => Package['snmpd'],
|
||||
}
|
||||
|
||||
File['/etc/init.d/snmpd'] -> Service['snmpd']
|
||||
|
||||
}
|
||||
|
||||
file { '/etc/snmp/snmpd.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
|
Loading…
x
Reference in New Issue
Block a user