# qlist -Iv |grep openrc sys-apps/openrc-0.43.5 # grep -e . /var/run/snmpd-supervise.pid /var/run/snmpd.pid /var/run/snmpd-supervise.pid:30047 /var/run/snmpd.pid:17242 # ps faux |grep [s]nmpd root 30047 0.0 0.0 2900 1288 ? S Aug21 0:00 supervise-daemon snmpd --start --pidfile /var/run/snmpd-supervise.pid /usr/sbin/snmpd -- -p /var/run/snmpd.pid -Lsd -Lf /dev/null -x /var/agentx/master -f root 17242 0.1 0.0 24012 12236 ? Ss Aug24 1:42 \_ /usr/sbin/snmpd -p /var/run/snmpd.pid -Lsd -Lf /dev/null -x /var/agentx/master -f # rc-status -a |grep snmpd snmpd [ stopped ] # grep -v -e '^#' -e '^$' /etc/conf.d/snmpd SNMPD_FLAGS="-Lsd -Lf /dev/null -x /var/agentx/master -f" supervisor="supervise-daemon" # diff /usr/portage/net-analyzer/net-snmp/files/snmpd.init.2 /etc/init.d/snmpd -Nuar --- /usr/portage/net-analyzer/net-snmp/files/snmpd.init.2 2017-02-28 20:43:13.000000000 +0000 +++ /etc/init.d/snmpd 2021-08-05 22:47:51.110642303 +0000 @@ -8,7 +8,7 @@ command="/usr/sbin/snmpd" command_args="-p ${SNMPD_PIDFILE} ${SNMPD_FLAGS}" -pidfile="${SNMPD_PIDFILE}" +pidfile="/var/run/snmpd-supervise.pid" depend() { use logger
/run/openrc/failed/snmpd exists so openrc thinks the service is failed. service_started => looks for /run/openrc/started/snmpd; which is absent which is why we think the service is not in state running (and e.g. /etc/init.d/snmpd status returns 'stopped'.) Failed is a subset of stopped ;) We then arrive at the open question of "why did openrc mark the service as failed when it is not failed." We need a PoC for that. -A
infra /etc/snmp/snmpd.conf: disk / 10% load 12 12 12 syslocation Gentoo Infrastructure syscontact "root@gentoo.org" sysservices 72
(In reply to Alec Warner from comment #1) > /run/openrc/failed/snmpd exists so openrc thinks the service is failed. > > service_started => looks for /run/openrc/started/snmpd; which is absent > which is why we think the service is not in state running (and e.g. > /etc/init.d/snmpd status returns 'stopped'.) Failed is a subset of stopped ;) > > We then arrive at the open question of "why did openrc mark the service as > failed when it is not failed." We need a PoC for that. > > -A My guess on this is that in May we changed the pidfile for supervise-daemon. This would cause openrc to potentially 'lose track' of the existing supervisor. Then for some unrelated reason we tried to restart snmpd. This caused openrc to spawn supervise-daemon (a second one) to start (a second) snmpd. This fails (since it binds to a port, etc.) This failure will cause supervise-daemon to mark the service as state=failure. This will cause openrc ot report the service as stopped. This will cause puppet to start the service every run; however /etc/init.d/snmpd start will not work as the daemon is already technically running. -A