perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pradeep kumar <pradeep.sm...@gmail.com>
Subject Re: [mp2] <Perl> Directive changes the command nam
Date Tue, 08 Nov 2005 09:28:40 GMT
I tried to read the whole of argv and push it in
modperl_config_srv_argv_push(). But what I can get only upto
"/app/apache/bin/httpd -d /app/apache" and not the whole of
"/app/apache/bin/httpd -d /app/apache -k start". I tried to print argv[3]
which just gave me null. How can I get the rest of the arguments.

On 10/12/05, Philippe M. Chiasson <gozer@ectoplasm.org> wrote:
>
> pradeep kumar wrote:
> > Hi,
> >
> > I got the fix from http://svn.apache.org/viewcvs.cgi?view=rev&rev=291193
> > <http://svn.apache.org/viewcvs.cgi?view=rev&rev=291193>. This solves the
> > problem partially. I used that fix. But this gives only the command name
> > instead of the whole of the command line.
>
> Yes, that an unfortunate side effect of how perl_parse functions.
>
> The typical embedder's method of calling perl_parse() like this:
> perl_parse(my_perl, NULL, 3, {"", "-e","0" }, NULL);
>
> Causes a side effect of setting $0 to '-e', which in turn, on HPUX
> will call pstat(PSTAT_SETCMD, [...]); Causing the original problem.
>
> The _only_ solution I can currently think of is what I implemented.
> Reset $0 to argv[0]. And that's why you see only the name of the binary.
>
> I am not sure if this could be somehow fixed by resetting $0 not only
> to argv[0], but to a concatenation of argv[0..argc].
>
> I am starting to think perl_parse() should be somewhat less magical...
>
> > #ps -eaf | grep httpd
> >
> > I normally get something like:
> > root 3634 1 0 20:31 ? 00:00:00 /app/apache/bin/httpd -k start
> > [...]
> >
> > But the fix gives only
> >
> > #ps -eaf | grep httpd
> >
> > root 3634 1 0 20:31 ? 00:00:00 /app/apache/bin/httpd
> > [...]
> >
> > without the arguments passed.
>
>
> --
> Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID :
> 88C3A5A5
> http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
> 88C3A5A5
>
>
>

Mime
View raw message