Hi,
I'm having a weird 'problem'... actually, it's just a nuisance, but I'd like to know if
1) it can be solved
2) it's only a nuisance or it could be hidin' something else...
I'm using:
apache httpd 2.0.48 w/mod_perl 1.99.12 (under RedHat linux 7.2 w/stock perl 5.6.1 installed from rpm) and I just started toying around with the <Perl > directive (in order to get VirtualHost data from an LDAP directory).
Everything is working OK, but whenever I use <Perl >, the output of "ps - ef" changes.
I normally get something like: root 3634 1 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start nobody 3635 3634 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start nobody 3636 3634 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start nobody 3637 3634 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start nobody 3638 3634 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start nobody 3639 3634 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start
However, as soon as I put a single line between <Perl > and </Perl> (even if the line is empty), I get something like:
root 3738 1 2 20:34 ? 00:00:00 /app/apache/bin/-e -k start
nobody 3739 3738 0 20:34 ? 00:00:00 /app/apache/bin/-e -k start
nobody 3740 3738 0 20:34 ? 00:00:00 /app/apache/bin/-e -k start
nobody 3741 3738 0 20:34 ? 00:00:00 /app/apache/bin/-e -k start
nobody 3742 3738 0 20:34 ? 00:00:00 /app/apache/bin/-e -k start
nobody 3743 3738 0 20:34 ? 00:00:00 /app/apache/bin/-e -k start
ps -e keeps working fine: 3738 ? 00:00:00 httpd 3739 ? 00:00:00 httpd 3740 ? 00:00:00 httpd 3741 ? 00:00:00 httpd 3742 ? 00:00:00 httpd 3743 ? 00:00:00 httpd
Is this a bug? A feature? An error on my part?
This is not an error on your part. <Perl> sections set $0 to the name of the file they were originated from. That affects argv[0] (perl does that). For example:
% perl -le '$0 = "foo"; sleep 20'
sets argv[0] to 'foo', so "ps -ef | grep foo" will show that process and not perl.
I was trying to restore argv[0] to 'httpd', but it looks like perl does some internal magic in main(), limiting the set_magic to PL_origalen which for some reason is very short. so I get back things like 'htt' instead of 'httpd'.
I can see the problem you have reported and still looking at possible solutions.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html