[collectd] Strange issue with exec and unixsock plugin

XANi xani666 at gmail.com
Mon Aug 23 04:02:57 CEST 2010


Hi,

after upgrading to 4.10.1 (from debian testing) ive encountered a
strange issue. Im using exec plugin to monitor some (jstat and haproxy)
part of infrastructure ad my test(to induce the bug) config looks like
that:
------ collectd.conf ------
FQDNLookup true
LoadPlugin syslog

<Plugin syslog>
LogLevel info
</Plugin>

LoadPlugin network
LoadPlugin exec
LoadPLugin df
LoadPlugin disk
LoadPlugin load
LoadPlugin cpu
LoadPlugin unixsock

<Plugin exec>
Exec nobody "/usr/local/bin/a.pl"
# Exec "user:group" "/path/to/exec"
# NotificationExec user "/path/to/exec"
</Plugin>

<Plugin network>
Server "192.168.1.4" "25826"
</Plugin>
<Plugin unixsock>
SocketFile "/var/run/collectd-unixsock"
SocketGroup "collectd"
SocketPerms "0660"
</Plugin>


Include "/etc/collectd/filters.conf"
Include "/etc/collectd/thresholds.conf"
------


and testscript "/usr/local/bin/a.pl":
--- a.pl ---
#!/usr/bin/perl
print "PUTVAL hydra/collecttest/derive-test interval=10 " . time() .
":" . ( time() + (rand() * 5) ). "\n";
open(L, ">> /tmp/log.log");
print L time() . "\n";
---
(basically feed some random data and save into log last run timestamp)

So after running something like:  
while sleep 30 ; do /etc/init.d/collectd restart; done
after some time (sometimes few minutes sometimes an hour or more) i get
tons of collectd processes lying around (ive added output of ps aux as
attachment) and sometimes after restart.
So then i wrote simple script to trigger the bug:
--
#!/usr/bin/perl
while(sleep 20) {
    system("/etc/init.d/collectd restart");
    sleep 5;
    $n=`ps uax |grep collectd |grep -v grep|wc -l`;
    if ($n > 1) {
system('ps aux |grep collectd|grep -v grep');
print "Gotcha!\n";
exit 0;
    }
}
--
It seems to trigger when both exec and unixsock plugins are on, if i
turn off one of them it works fine. Ah and im using 64 bit debian
testing.






-- 
Mariusz Gronczewski (XANi) <xani666 at gmail.com>
GnuPG: 0xEA8ACE64
http://devrandom.pl


-------------- next part --------------
hydra:~☠ ps aux |grep col
root      1703  0.0  0.0  90884   708 ?        S    13:03   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      3508  0.0  0.0  90884   700 ?        S    13:09   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      3560  0.0  0.0  90888   704 ?        S    13:09   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      3697  0.0  0.0  90888   704 ?        S    13:10   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      3777  0.0  0.0 156424   744 ?        S    13:11   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4015  0.0  0.0 156548   736 ?        S    13:12   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4066  0.0  0.0  90884   728 ?        S    13:13   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4116  0.0  0.0 156556   748 ?        S    13:13   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4166  0.0  0.0 158628   760 ?        S    13:14   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4274  0.0  0.0 222092   752 ?        S    13:15   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4324  0.0  0.0 156552   740 ?        S    13:16   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4547  0.0  0.0 148224   700 ?        S    13:18   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4599  0.0  0.0  90884   704 ?        S    13:18   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4650  0.0  0.0  90892   732 ?        S    13:19   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      4920  0.0  0.0 156420   712 ?        S    13:21   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5035  0.0  0.0  90892   736 ?        S    13:22   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5085  0.0  0.0 156552   736 ?        S    13:22   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5135  0.0  0.0 156548   732 ?        S    13:23   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5300  0.0  0.0 158636   752 ?        S    13:25   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5464  0.0  0.0 156552   740 ?        S    13:26   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5519  0.0  0.0 158632   736 ?        S    13:27   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5625  0.0  0.0  82688   708 ?        S    13:28   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5682  0.0  0.0 221960   760 ?        S    13:28   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5734  0.0  0.0  90888   704 ?        S    13:29   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
root      5919  0.0  0.0 230408  1596 ?        SLsl 13:30   0:00 /usr/sbin/collectd -C /etc/collectd/collectd.conf -P /var/run/collectd.pid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100823/8ad98812/attachment.pgp 


More information about the collectd mailing list