diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-01-17 20:53:52 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-01-17 20:53:52 +0000 |
commit | dd9cdac5ae5491f1e62535509dee34ea5246a5ac (patch) | |
tree | e8c099c21681703c4f5fa8f73f58fe6c74027112 /regress | |
parent | f833cd6cd3feb9d6ba1c424d8966fcdd10bc7d34 (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@
Diffstat (limited to 'regress')
-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: |