Now that we're explicitly connecting via TCP to localhost:705 (which can be overriden by the -a flag), we no longer need to run as root. Therefore, update vpp-snmp-agent.service to run as user Debian-snmp group vpp, so that /run/vpp/{api,stats}.sock are writable. Be explicit on the commandline arguments in the service definition.
18 lines
389 B
Desktop File
18 lines
389 B
Desktop File
[Unit]
|
|
Description=SNMP AgentX Daemon for VPP dataplane statistics
|
|
After=network.target
|
|
ConditionPathExists=/etc/snmp/snmpd.conf
|
|
|
|
[Service]
|
|
Type=simple
|
|
NetworkNamespacePath=/var/run/netns/dataplane
|
|
ExecStart=/usr/sbin/vpp-snmp-agent -a localhost:705 -p 30
|
|
User=Debian-snmp
|
|
Group=vpp
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
Restart=on-failure
|
|
RestartSec=5s
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|