175c175
< modperl_config_srv_t *modperl_config_srv_new(apr_pool_t *p, server_rec *s)
---
> modperl_config_srv_t *modperl_config_srv_new(apr_pool_t *p)
177,178d176
< int i=0,len=0;
< char *str1=NULL;
202,203c200,211
< /* make sure httpd's argv[0] is the first argument so $0 is
< * correctly connected to the real thing */
---
> /* must copy ap_server_argv0, because otherwise any read/write of
> * $0 corrupts process' argv[0] (visible with 'ps -ef' on most
> * unices). This is due to the logic of calculating PL_origalen in
> * perl_parse, which is later used in set_mg.c:Perl_magic_set() to
> * truncate the argv[0] setting. remember that argv[0] passed to
> * perl_parse() != process's real argv[0].
> *
> * as a copying side-effect, changing $0 now doesn't affect the
> * way the process is seen from the outside.
> */
> modperl_config_srv_argv_push(apr_pstrmemdup(p, ap_server_argv0,
> strlen(ap_server_argv0)));
205,217d212
< for(i=0;i<s->process->argc;i++)
< {
< len+=strlen(s->process->argv[i]);
< len++;
< }
< str1=(char *)malloc(len);
< for(i=0;i<s->process->argc;i++)
< {
< strcat(str1,s->process->argv[i]);
< strcat(str1," ");
< }
< modperl_config_srv_argv_push(str1);
266c261
< modperl_config_srv_t *scfg = modperl_config_srv_new(p, s);
---
> modperl_config_srv_t *scfg = modperl_config_srv_new(p);
317c312
< *mrg = modperl_config_srv_new(p, add->server);
---
> *mrg = modperl_config_srv_new(p);
Somehow the "-k start" which is given at the command line is not getting reflected in argv. This goes missing from argv. So when I start apache as
#/app/apache/bin/httpd -d /app/apache -k start
#ps -eaf | grep www
www 20734 20724 0 12:59:55 ? 0:00 /app/apache/bin/httpd -d /app/apache
www 20733 20724 0 12:59:55 ? 0:00 /app/apache/bin/httpd -d /app/apache
root 20724 1 0 12:59:53 ? 0:01 /app/apache/bin/httpd -d /app/apache
www 20729 20724 0 12:59:54 ? 0:00 /app/apache/bin/httpd -d /app/apache
#/app/apache/bin/httpd -d /app/apache -k startssl
#ps -eaf | grep www
www 20734 20724 0 12:59:55 ? 0:00 /app/apache/bin/httpd -d /app/apache -D SSL
www 20733 20724 0 12:59:55 ? 0:00 /app/apache/bin/httpd -d /app/apache -D SSL
root 20724 1 0 12:59:53 ? 0:01 /app/apache/bin/httpd -d /app/apache -D SSL
www 20729 20724 0 12:59:54 ? 0:00 /app/apache/bin/httpd -d /app/apache -D SSL
This however is not giving me the "-k start". How can I get that.
On 11/10/05, Philippe M. Chiasson <[EMAIL PROTECTED]> wrote:
pradeep kumar wrote:
> 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.
Not sure I follow exactly what you are saying, but please, post whatever
code you have, it's usually much better than trying to explain code (a diff
would be great)
But once again, like I said, we are being bitten by too much magic here, and
especially on HP-UX, it might not even be possible to reset the process full
command name + command arguments at all.
--------------------------------------------------------------------------------
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