diff options
| author | 2021-01-17 20:53:51 +0000 | |
|---|---|---|
| committer | 2021-01-17 20:53:51 +0000 | |
| commit | c9239f201ab41de3941b80e1d00a2fbaefccc1da (patch) | |
| tree | 88fb33ec85e38588f4449bd958469c10a8ab279b | |
| parent | umb(4) sets a default interface priority too; mention it here (diff) | |
Put a sleep 1 after starting net-snmpd. The reason of the race is
unclear, noone wants to debug net-snmpd. Goal it to replace this
mess with proper agentx support in snmpd.
OK martijn@
| -rw-r--r-- | regress/lib/libagentx/Makefile | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/regress/lib/libagentx/Makefile b/regress/lib/libagentx/Makefile index 3182f9f1bba..6ff7c6dc79f 100644 --- a/regress/lib/libagentx/Makefile +++ b/regress/lib/libagentx/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2021/01/15 14:36:16 bluhm Exp $ +# $OpenBSD: Makefile,v 1.5 2021/01/17 20:53:51 bluhm Exp $ .if ! exists(/usr/local/sbin/snmpd) regress: @@ -17,18 +17,24 @@ REGRESS_TARGETS= run-regress-walk REGRESS_CLEANUP= stop CLEANFILES= -SNMPD_CMD= /usr/local/sbin/snmpd -r -c snmpd.conf -Le +SNMPD_CMD= /usr/local/sbin/snmpd -r -C -c snmpd.conf -Le +UID!!= id -u +.if ${UID} == 0 +SNMPD_CMD+= -u _netsnmp +.endif CLEANFILES+= snmpd.conf -snmpd.conf: +snmpd.conf: Makefile @printf "agentaddress udp:127.0.0.1:6161\n" > snmpd.conf @printf "rwcommunity public\n" >> snmpd.conf @printf "master agentx\n" >> snmpd.conf - @printf "agentXSocket ${.OBJDIR}/agentx.sock\n" >> snmpd.conf + @printf "agentXSocket agentx.sock\n" >> snmpd.conf CLEANFILES+= agentx.sock start: stop snmpd.conf agentx ${SNMPD_CMD} + # XXX Race in net-snmpd, socket exists before data is available. + sleep 1 ./agentx agentx.sock stop: |
