Hi Gurus,

I'm using Apache 1.3.33 with mod_perl 1.29. In Apache httpd.conf file I'm
loading external perl directives using:
    PerlRequire startup.pl

I've checked, that during apache startup 'startup.pl' runs two times. And
I want, that this script runs only once (because I'm allocating there
shared memory areas for later use).

So, question is: how to force Apache to run this script exactly once during
startup.

In my other servers with previous versions of Apache and mod_perl I've used
in startup script directive:
  return 1 if ( getppid() != 1 );
and it solved the problem - commands after this one were executed only
once. But now it doesn't work.


I've tried this in startup.pl:
  WriteToDebugFile( "begin, getppid=".getppid()." getpid=".$$." );
  return 1 if ( getppid() != 1 );
  WriteToDebugFile( "Done" );

And after apache run i've found in debug-file this:
  begin, getppid=1005 getpid=1006
  begin, getppid=1005 getpid=1006


I've checked pid's of starting Apache processes:
1. I've started Apache:
  sh /www/apache_1.3.33/bin/apachectl start 
  (Pid: 1005, Parent: 1004)
2. One process was started
  /www/apache_1.3.33/bin/httpd -f /www/conf/httpd.conf 
  (Pid: 1006, Parent: 1005)
3. After some time (and executing TWO times startup.pl) apache was ready:
   /www/apache_1.3.33/bin/httpd -f /www/conf/httpd.conf
   (Pid:1009, Parent: 1)
   /www/apache_1.3.33/bin/httpd -f /www/conf/httpd.conf
   (Pid: 1012, Parent 1009)
   .
   .
   .
   (other workers)


-- 
 | Marcin Kosewski
 | [EMAIL PROTECTED]
-+------------------------------------------------------------------------
 |

-- 
Report problems: 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

Reply via email to