httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milind Vaidya <kava...@gmail.com>
Subject [users@httpd] logrotate, httpd and piping messages to java program
Date Tue, 14 Mar 2017 19:46:50 GMT
Hi

I asked following question few days ago:

I am writing messages to error_log file as well as sending to std out.
>
> The setting looks like
>
ErrorLog  "| /usr/bin/tee -a /var/log/httpd/error_log |  java -cp
producer.jar stdin.producer.StdInProducer /CustomProducer/config.json
>> /producer_init.log 2>&1"`
>
>
When httpd is started it spawns 2 processes and adds one every one hour,
keeping all alive

Only other thing happening per hour is rotation of error_log file by
logrotate with copytruncate option (which copies the file data and
truncates original file keeping the file descriptor unchanged )

I also tested it with another program with setting as follows which runs
fine

ErrorLog  "| /usr/bin/tee -a /var/log/httpd/error_log |
/usr/bin/logger -u /tmp/apache_log.socket"

I got answer to that indicating me to terminate the program after
program encounters EOF. I did that and it was running for a while. Now
I see that the java program which is supposed to end and start every
hour when the logrotate - copytruncate command runs, it is not
happening so. It has been running for more than few days now. So I am
wondering is there anything wrong in what I am doing ? There is not
error as such, but the behaviour changed from last time and the
earlier one was desired one. The logrotate is working fine and cutting
the file every hour without any problem. So I was wondering what is
happening here ? Is EOF missing or it is not being treated properly
over piping ? Any pointers ?

Mime
View raw message