File: snmpd.init

package info (click to toggle)
net-snmp 5.9+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 36,760 kB
  • sloc: ansic: 283,039; perl: 17,712; sh: 11,887; makefile: 2,705; xml: 663; python: 623; pascal: 62; sql: 47
file content (48 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:           snmpd
# 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>
#

DESC="SNMP Services"
DAEMON=/usr/sbin/snmpd
PIDFILE="/run/snmpd.pid"

DEFAULT_SNMPDOPTS="-LSwd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf"

set_daemon_options()
{
        [ -z "$SNMPDOPTS" ] && SNMPDOPTS=$DEFAULT_SNMPDOPTS
        DAEMON_ARGS="$SNMPDOPTS -p $PIDFILE"

}

do_restart_prepare()
{
	set_daemon_options
}

do_start_prepare()
{
	set_daemon_options

    	# remove old symlink with previous version
    	if [ -L /var/run/agentx ]; then
		rm -f /var/run/agentx
	fi
	if [ ! -d /var/run/agentx ]; then
		mkdir -p /var/run/agentx
	fi
}