hi!

i tried to use AP_HAVE_RELIABLE_PIPED_LOGS with a java program that
parses vhost logs and provides access to some log through a tcp/ip socket.

the problem is, that java cannot bind the socket cause it is already
bound to a process that launched a couple of seconds before the current one.

gentoo compiled apache with -D AP_HAVE_RELIABLE_PIPED_LOGS and thus
tries to respwan the process if it hangs.
after apache started, the java program tries to come up but after a
second it crashes. i tried to use simple shell scripts that just log a
line into a logfile and afterwards reads from stdin endlessly. this
shell script starts (logs) often at least two times after apache
started. sometimes it works after the first try but there are even three
or more processes that come up before the last remains.

after trying to read log.c, mod_log_config.c and main.c i cannot
determine the condition that must be true that the spawned processs
looks like "running" that apache. how do you determine if the spawned
process is running or not? maybe the startup of the piped process lasts
to long and thats the reason why apache tries to restart reliably? in
this configuration apache tries to parse at least 32.000 lines of
configuration so the startup time varies.

to solve my problem there are two possibilities (for java process purposes):
1. determine that apache shut me down, so close the socket that the next
spawned java process can bind the socket
2. ensure that apache just spawns one process after startup and waits
some (more) time until the java program comes up


does anyone know how to deal with that issue?

here some server details:

CustomLog "|java -cp /ApacheLogMultiplexer ApacheLogMultiplexer
/ApacheLogMultiplexer/accesslog.xml" vhost

using: Apache/2.2.6 (Unix)
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)

Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

regards, armin

Reply via email to