Hi all
While receiving traps snmptrapd stops handling traps because it waits the
child traphandler to fihish.
snmptrapd waits the child to finish:
[EMAIL PROTECTED] ulisses]# strace -p 29661
Process 29661 attached - interrupt to quit
--- SIGSTOP (Stopped (signal)) @ 0 (0) ---
--- SIGSTOP (Stopped (signal)) @ 0 (0) ---
wait4(2420, <unfinished ...>
This is the child tree:
# ps axf
29661 ? Ss 0:00 /usr/sbin/snmptrapd -c /etc/snmp/snmptrapd.conf
-Lf /var/log/snmptrap.log -p /var/run/snmptrapd.pid -M
/usr/local/share/snmp/mib\
2420 ? S 0:00 \_ /usr/bin/perl /usr/local/bin/traptoemail -s
ZZZZZZ -f [EMAIL PROTECTED] [EMAIL PROTECTED]
2422 ? S 0:00 \_ sh -c snmpwalk -v 2c -c XXXXX YYYYYYY
ifDescr.648 | sed 's/ Name /:/g'
2424 ? S 0:00 \_ sed s/ Name /:/g
2423 ? S 0:00 \_ snmpwalk -v 2c -c
GW-Barcelona0 ifDescr.648
###
child process are either blocking in reading or writing, the full
communication
between process is reported below:
# strace -p 2420 (traptoemail) -- reads stdout from sh and sed
Process 2420 attached - interrupt to quit
read(3, <unfinished ...>
# strace -p 2422 (sh -c snmpwalk | sed)
Process 2422 attached - interrupt to quit
wait4(-1, <unfinished ...>
# strace -p 2424 (sed) -- reads stdout from snmpwalk
Process 2424 attached - interrupt to quit
read(0, <unfinished ...>
# strace -p 2423 (snmpwalk) -- *** and this is the deadlock ***
Process 2423 attached - interrupt to quit
write(2, "Object not found in module (mpls"..., 122 <unfinished ...>
stdout and stderr of traptoemail and stderr of all child process are
writting
to a pipe. This pipe is read by sanmptrapd, that as shown before is waiting
for the childs to die:
# lsof -n | grep "150363087 pipe"
traptoema 2420 root 1w FIFO 0,7
150363087 pipe
traptoema 2420 root 2w FIFO 0,7
150363087 pipe
sh 2422 root 2w FIFO 0,7
150363087 pipe
snmpwalk 2423 root 2w FIFO 0,7
150363087 pipe
sed 2424 root 2w FIFO 0,7
150363087 pipe
snmptrapd 29661 root 11r FIFO 0,7
150363087 pipe
and another proof that snmpwalk is blocked:
[EMAIL PROTECTED] ulisses]# ps -p 2423 -o wchan
WCHAN
pipe_wait
also, I have executed the pipe from the command line and it works ok.
I think this is a bug. Any comment will be greatly appreciated.
regards
Ulisses
##########################################################################################
[EMAIL PROTECTED] ulisses]# lsof -n -p 29661 -p 2420 -p 2422 -p 2423 -p 2424 |
grep -i pipe
traptoema 2420 root 0r FIFO 0,7 150363086 pipe
traptoema 2420 root 1w FIFO 0,7 150363087 pipe
traptoema 2420 root 2w FIFO 0,7 150363087 pipe
traptoema 2420 root 3r FIFO 0,7 150363094 pipe
sh 2422 root 0r FIFO 0,7 150363086 pipe
sh 2422 root 1w FIFO 0,7 150363094 pipe
sh 2422 root 2w FIFO 0,7 150363087 pipe
snmpwalk 2423 root 0r FIFO 0,7 150363086 pipe
snmpwalk 2423 root 1w FIFO 0,7 150363096 pipe
snmpwalk 2423 root 2w FIFO 0,7 150363087 pipe
sed 2424 root 0r FIFO 0,7 150363096 pipe
sed 2424 root 1w FIFO 0,7 150363094 pipe
sed 2424 root 2w FIFO 0,7 150363087 pipe
snmptrapd 29661 root 3r FIFO 0,7 150346528 pipe
snmptrapd 29661 root 4w FIFO 0,7 150346528 pipe
snmptrapd 29661 root 5r FIFO 0,7 150346530 pipe
snmptrapd 29661 root 6w FIFO 0,7 150346530 pipe
snmptrapd 29661 root 11r FIFO 0,7 150363087 pipe
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users