[smokeping-users] FastCGI orphaned process issue, fix

Eric Searcy emsearcy at gmail.com
Thu May 17 21:01:18 CEST 2012


I discovered on my system (Smokeping 2.6.8, RHEL6, Apache 2.2, mod_fcgid
2.3.7) that Smokeping CGI procs became orphaned on both Apache restarts
and graceful/reloads.

 2506 ?        Ss     0:32 /usr/sbin/httpd.worker
25417 ?        S      0:00  \_ /usr/sbin/httpd.worker
25530 ?        S      0:00  |   \_ /bin/sh
/opt/smokeping-2.6.8/htdocs/smokeping.fcgi
25531 ?        S      0:01  |       \_ /usr/bin/perl
/opt/smokeping-2.6.8/bin/smokeping_cgi /opt/smokeping-2.6.8/etc/config
25418 ?        Sl     0:00  \_ /usr/sbin/httpd.worker
25419 ?        Sl     0:00  \_ /usr/sbin/httpd.worker
25420 ?        Sl     0:00  \_ /usr/sbin/httpd.worker
 2658 ?        S      0:02 /usr/bin/perl
/opt/smokeping-2.6.8/bin/smokeping_cgi /opt/smokeping-2.6.8/etc/config
 5979 ?        S      0:04 /usr/bin/perl
/opt/smokeping-2.6.8/bin/smokeping_cgi /opt/smokeping-2.6.8/etc/config
10350 ?        S      0:02 /usr/bin/perl
/opt/smokeping-2.6.8/bin/smokeping_cgi /opt/smokeping-2.6.8/etc/config
[...]

Connecting strace shows that FastCGI sends a TERM signal to the
smokeping.fcgi process (25530 above) but it's child 25531 doesn't get
any signal and joins the growing list of orphans.  (and no, not caused
by SELinux.)

Fix: changing smokeping.fcgi from the .dist ...

#!/bin/sh
/opt/smokeping-2.6.8/bin/smokeping_cgi /opt/smokeping-2.6.8/etc/config

to:

#!/bin/sh
exec /opt/smokeping-2.6.8/bin/smokeping_cgi /opt/smokeping-2.6.8/etc/config

... resolves the problem for me.  I suspect the "exec" should work in
all cases (regular CGI too).

Anybody else see this behavior?

Eric

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: OpenPGP digital signature
Url : http://lists.oetiker.ch/pipermail/smokeping-users/attachments/20120517/524ccd3c/attachment.pgp 


More information about the smokeping-users mailing list