package/netsnmp: add a snmp user so snmpd doesn't run as root
Signed-off-by: David Johnson <dave-git@centerclick.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
15a7077a06
commit
d582bf978f
@ -17,7 +17,7 @@ export PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
# Defaults
|
||||
export MIBDIRS=/usr/share/snmp/mibs
|
||||
SNMPDRUN=yes
|
||||
SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid 127.0.0.1'
|
||||
SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid -u snmp -g snmp 127.0.0.1'
|
||||
TRAPDRUN=no
|
||||
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
|
||||
|
||||
|
@ -41,6 +41,10 @@ NETSNMP_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) LIB_LDCONFIG_CMD=true instal
|
||||
NETSNMP_MAKE = $(MAKE1)
|
||||
NETSNMP_CONFIG_SCRIPTS = net-snmp-config
|
||||
|
||||
define NETSNMP_USERS
|
||||
snmp -1 snmp -1 * - - - snmpd user
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_INIT_SYSTEMD),y)
|
||||
NETSNMP_CONF_OPTS += --with-systemd
|
||||
else
|
||||
|
@ -6,7 +6,7 @@ ConditionPathExists=/etc/snmp/snmpd.conf
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=MIBDIRS=/usr/share/snmp/mibs
|
||||
Environment=SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid 127.0.0.1'
|
||||
Environment=SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid -u snmp -g snmp 127.0.0.1'
|
||||
EnvironmentFile=-/etc/default/snmpd
|
||||
PassEnvironment=MIBDIRS
|
||||
ExecStart=/usr/sbin/snmpd -f $SNMPDOPTS
|
||||
|
Loading…
Reference in New Issue
Block a user