You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Herbert G. Fischer" <he...@trama.com> on 2003/11/18 20:35:10 UTC

[users@httpd] rotatelogs and cronolog don't die!

Hi,

I'm having the same problem on both Apache 2.0.47 and 2.0.48
with both cronolog and rotatelogs. Both them are running on
Slackware 9.1 with customized kernel.

The problem is:

When Apache starts, it starts all cronolog (or/and rotatelogs) "instances"
correctly, but,
when I stop Apache, all cronolog (or/and rotatelogs) instances remain
running (not zombie).
And starting Apache again, it starts another set of instances of cronolog
(or/and rotatelogs),
leaving a lot of cronologs running on the system.

[]s,

Herbert


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by Brian Dessent <br...@dessent.net>.
"Herbert G. Fischer" wrote:
> 
> New information
> 
> Correction:
> 
> After stoping Apache, the pipe log programs stops too, but Apache forks
> another set of them
> before stoping itself.

I suppose if you want to debug this more you should write a simple perl
script that does nothing other than sit there and log all signals
received.  When Apache is going down it should send a SIGTERM to the
program that it has invoked, or at least close the pipe and send
SIGPIPE.  If the program is not receiving these signals then it could be
an Apache thing.

Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by "Herbert G. Fischer" <he...@trama.com>.
New information

Correction:

After stoping Apache, the pipe log programs stops too, but Apache forks
another set of them
before stoping itself.

# apachectl start
# ps axuww

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root     18785  1.0  0.7 22832 7732 ?        S    21:52   0:00
/usr/local/httpd-2.0.48/bin/httpd -k start
apache   18788  0.0  0.7 22856 7772 ?        S    21:52   0:00
/usr/local/httpd-2.0.48/bin/httpd -k start
apache   18789  0.0  0.7 22856 7772 ?        S    21:52   0:00
/usr/local/httpd-2.0.48/bin/httpd -k start
apache   18790  0.0  0.7 22856 7772 ?        S    21:52   0:00
/usr/local/httpd-2.0.48/bin/httpd -k start
apache   18791  0.0  0.7 22856 7772 ?        S    21:52   0:00
/usr/local/httpd-2.0.48/bin/httpd -k start
apache   18792  0.0  0.7 22856 7772 ?        S    21:52   0:00
/usr/local/httpd-2.0.48/bin/httpd -k start
root     18786  0.0  0.0  1480  268 ?        S    21:52   0:00
/usr/local/sbin/cronolog /usr/local/sites/portal/logs/access.%Y-%m-%d.log
root     18787  0.0  0.0  1480  268 ?        S    21:52   0:00
/usr/local/sbin/cronolog /usr/local/sites/default/logs/access.%Y-%m-%d.log

# apachectl stop
# ps axuww

root     18819  0.0  0.0  1480  268 ?        S    21:54   0:00
/usr/local/sbin/cronolog /usr/local/sites/default/logs/access.%Y-%m-%d.log
root     18820  0.0  0.0  1480  268 ?        S    21:54   0:00
/usr/local/sbin/cronolog /usr/local/sites/portal/logs/access.%Y-%m-%d.log

----- Original Message ----- 
From: "Jez Hancock" <je...@munk.nu>
To: <us...@httpd.apache.org>; "Herbert G. Fischer" <he...@trama.com>
Sent: Tuesday, November 18, 2003 8:37 PM
Subject: Re: [users@httpd] rotatelogs and cronolog don't die!


> On Tue, Nov 18, 2003 at 08:32:35PM -0200, Herbert G. Fischer wrote:
> > Just a new information...
> >
> > The problem is generalized to any "piped log program".
> > I tested with a simple grep command as a piped log program and it
remains
> > running after Apache is stoped.
> Perhaps it is a genuine bug then - certainly works very well in my
> experience (cronolog and a custom perl loggging daemon via a pipe) on
1.3.x.
> Would be useful to hear from other 2.0 users who use piped logging eh?
>
> -- 
> Jez Hancock
>  - System Administrator / PHP Developer
>
> http://munk.nu/
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by Jez Hancock <je...@munk.nu>.
On Tue, Nov 18, 2003 at 08:32:35PM -0200, Herbert G. Fischer wrote:
> Just a new information...
> 
> The problem is generalized to any "piped log program".
> I tested with a simple grep command as a piped log program and it remains
> running after Apache is stoped.
Perhaps it is a genuine bug then - certainly works very well in my
experience (cronolog and a custom perl loggging daemon via a pipe) on 1.3.x.
Would be useful to hear from other 2.0 users who use piped logging eh?

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by "Herbert G. Fischer" <he...@trama.com>.
Just a new information...

The problem is generalized to any "piped log program".
I tested with a simple grep command as a piped log program and it remains
running after Apache is stoped.

----- Original Message ----- 
From: "Herbert G. Fischer" <he...@trama.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, November 18, 2003 8:29 PM
Subject: Re: [users@httpd] rotatelogs and cronolog don't die!


> The problem is not directly with cronolog because I'm having the same
> problem with rotatelogs.
>
> I think that is something with Apache related to the standard libs from
> Slackware 9.1 because on Suse 7.3 PPC + Apache + Cronolog I don't have
this
> problem.
>
> The same problem was reproduced on another machine with Slack 9.1 and
Apache
> 2.0.47.
>
> I'm trying to understand Apache source to do some tests but I'm getting
very
> confused.
>
> I discovered that attaching strace to the main apache process and stoping
> apache, all "piped log programs" stops, maybe because Apache has some
> slowdown by the strace debug.
>
> Thanks for your help.
>
> I already had posted a bug report but I got no answers there.
>
> ----- Original Message ----- 
> From: "Jez Hancock" <je...@munk.nu>
> To: <us...@httpd.apache.org>
> Sent: Tuesday, November 18, 2003 8:23 PM
> Subject: Re: [users@httpd] rotatelogs and cronolog don't die!
>
>
> > On Tue, Nov 18, 2003 at 10:19:13PM +0000, Jez Hancock wrote:
> > > On Tue, Nov 18, 2003 at 08:00:19PM -0200, Herbert G. Fischer wrote:
> > > > I activated debug on Apache and discovered the following errors:
> > > >
> > > > piped log program '/usr/local/sbin/cronolog
> > > > /usr/local/sites/default/logs/access.%Y-%m-%d.log' failed
unexpectedly
> > > > piped log program '/usr/local/sbin/cronolog
> > > > /usr/local/sites/portal/logs/access.%Y-%m-%d.log' failed
unexpectedly
> > > Are you sure you have the "|/path/to/cronolog" part in the customlog
> > > line?  It sounds as though you're piping the errorlog directly to the
> > > file (template) /usr/local/sites/portal/logs/access.%Y-%m-%d.log
instead
> of:
> > > /path/to/cronolog /usr/local/sites/portal/logs/access.%Y-%m-%d.log
> > <snip>
> > Apologies I misread your last post :(  Have you tried rebuilding
> > cronolog? Sounds suspiciously like there's a problem with cronolog not
> > dealing with the output as it should.
> >
> > -- 
> > Jez Hancock
> >  - System Administrator / PHP Developer
> >
> > http://munk.nu/
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by "Herbert G. Fischer" <he...@trama.com>.
The problem is not directly with cronolog because I'm having the same
problem with rotatelogs.

I think that is something with Apache related to the standard libs from
Slackware 9.1 because on Suse 7.3 PPC + Apache + Cronolog I don't have this
problem.

The same problem was reproduced on another machine with Slack 9.1 and Apache
2.0.47.

I'm trying to understand Apache source to do some tests but I'm getting very
confused.

I discovered that attaching strace to the main apache process and stoping
apache, all "piped log programs" stops, maybe because Apache has some
slowdown by the strace debug.

Thanks for your help.

I already had posted a bug report but I got no answers there.

----- Original Message ----- 
From: "Jez Hancock" <je...@munk.nu>
To: <us...@httpd.apache.org>
Sent: Tuesday, November 18, 2003 8:23 PM
Subject: Re: [users@httpd] rotatelogs and cronolog don't die!


> On Tue, Nov 18, 2003 at 10:19:13PM +0000, Jez Hancock wrote:
> > On Tue, Nov 18, 2003 at 08:00:19PM -0200, Herbert G. Fischer wrote:
> > > I activated debug on Apache and discovered the following errors:
> > >
> > > piped log program '/usr/local/sbin/cronolog
> > > /usr/local/sites/default/logs/access.%Y-%m-%d.log' failed unexpectedly
> > > piped log program '/usr/local/sbin/cronolog
> > > /usr/local/sites/portal/logs/access.%Y-%m-%d.log' failed unexpectedly
> > Are you sure you have the "|/path/to/cronolog" part in the customlog
> > line?  It sounds as though you're piping the errorlog directly to the
> > file (template) /usr/local/sites/portal/logs/access.%Y-%m-%d.log instead
of:
> > /path/to/cronolog /usr/local/sites/portal/logs/access.%Y-%m-%d.log
> <snip>
> Apologies I misread your last post :(  Have you tried rebuilding
> cronolog? Sounds suspiciously like there's a problem with cronolog not
> dealing with the output as it should.
>
> -- 
> Jez Hancock
>  - System Administrator / PHP Developer
>
> http://munk.nu/
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by Jez Hancock <je...@munk.nu>.
On Tue, Nov 18, 2003 at 10:19:13PM +0000, Jez Hancock wrote:
> On Tue, Nov 18, 2003 at 08:00:19PM -0200, Herbert G. Fischer wrote:
> > I activated debug on Apache and discovered the following errors:
> > 
> > piped log program '/usr/local/sbin/cronolog
> > /usr/local/sites/default/logs/access.%Y-%m-%d.log' failed unexpectedly
> > piped log program '/usr/local/sbin/cronolog
> > /usr/local/sites/portal/logs/access.%Y-%m-%d.log' failed unexpectedly
> Are you sure you have the "|/path/to/cronolog" part in the customlog
> line?  It sounds as though you're piping the errorlog directly to the
> file (template) /usr/local/sites/portal/logs/access.%Y-%m-%d.log instead of:
> /path/to/cronolog /usr/local/sites/portal/logs/access.%Y-%m-%d.log
<snip>
Apologies I misread your last post :(  Have you tried rebuilding
cronolog? Sounds suspiciously like there's a problem with cronolog not
dealing with the output as it should.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by Jez Hancock <je...@munk.nu>.
On Tue, Nov 18, 2003 at 08:00:19PM -0200, Herbert G. Fischer wrote:
> I activated debug on Apache and discovered the following errors:
> 
> piped log program '/usr/local/sbin/cronolog
> /usr/local/sites/default/logs/access.%Y-%m-%d.log' failed unexpectedly
> piped log program '/usr/local/sbin/cronolog
> /usr/local/sites/portal/logs/access.%Y-%m-%d.log' failed unexpectedly
Are you sure you have the "|/path/to/cronolog" part in the customlog
line?  It sounds as though you're piping the errorlog directly to the
file (template) /usr/local/sites/portal/logs/access.%Y-%m-%d.log instead of:
/path/to/cronolog /usr/local/sites/portal/logs/access.%Y-%m-%d.log

sample cronolog customlog line:

CustomLog "| /usr/local/sbin/cronolog /usr/local/sites/default/logs/access.%Y-%m-%d.log" combined

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by "Herbert G. Fischer" <he...@trama.com>.
I activated debug on Apache and discovered the following errors:

piped log program '/usr/local/sbin/cronolog
/usr/local/sites/default/logs/access.%Y-%m-%d.log' failed unexpectedly
piped log program '/usr/local/sbin/cronolog
/usr/local/sites/portal/logs/access.%Y-%m-%d.log' failed unexpectedly

Any idea of what else I can check ?

this is the strace output:

wait4(-1, 0xbffff900, WNOHANG|WUNTRACED, NULL) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
wait4(-1, 0xbffff900, WNOHANG|WUNTRACED, NULL) = 0
select(0, NULL, NULL, NULL, {1, 0})     = ? ERESTARTNOHAND (To be restarted)
--- SIGTERM (Terminated) @ 0 (0) ---
sigreturn()                             = ? (mask now [RTMIN])
getpgrp()                               = 28370
kill(-28370, SIGTERM)                   = 0
--- SIGTERM (Terminated) @ 0 (0) ---
sigreturn()                             = ? (mask now [RTMIN])
--- SIGCHLD (Child exited) @ 0 (0) ---
select(0, NULL, NULL, NULL, {0, 16384}) = 0 (Timeout)
wait4(28373, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28373
wait4(28374, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28374
wait4(28375, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28375
wait4(28376, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28376
wait4(28377, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28377
wait4(28372, [WIFSIGNALED(s) && WTERMSIG(s) == SIGTERM], WNOHANG, NULL) =
28372
write(2, "piped log program \'/usr/local/sb"..., 115) = 115
pipe([17, 18])                          = 0
dup2(7, 17)                             = 17
dup2(11, 18)                            = 18
access("/usr/local/sbin/cronolog", R_OK|X_OK) = 0
fork()                                  = 28428
close(17)                               = 0
wait4(28371, [WIFSIGNALED(s) && WTERMSIG(s) == SIGTERM], WNOHANG, NULL) =
28371
write(2, "piped log program \'/usr/local/sb"..., 114) = 114
pipe([17, 19])                          = 0
dup2(5, 17)                             = 17
dup2(8, 19)                             = 19
access("/usr/local/sbin/cronolog", R_OK|X_OK) = 0
fork()                                  = 28429
close(17)                               = 0
unlink("/usr/local/httpd-2.0.48/logs/httpd.pid") = 0
getpid()                                = 28370
gettimeofday({1069192645, 791003}, NULL) = 0
write(13, "[Tue Nov 18 19:57:25 2003] [noti"..., 66) = 66


----- Original Message ----- 
From: "Herbert G. Fischer" <he...@trama.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, November 18, 2003 5:35 PM
Subject: [users@httpd] rotatelogs and cronolog don't die!


> Hi,
>
> I'm having the same problem on both Apache 2.0.47 and 2.0.48
> with both cronolog and rotatelogs. Both them are running on
> Slackware 9.1 with customized kernel.
>
> The problem is:
>
> When Apache starts, it starts all cronolog (or/and rotatelogs) "instances"
> correctly, but,
> when I stop Apache, all cronolog (or/and rotatelogs) instances remain
> running (not zombie).
> And starting Apache again, it starts another set of instances of cronolog
> (or/and rotatelogs),
> leaving a lot of cronologs running on the system.
>
> []s,
>
> Herbert
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rotatelogs and cronolog don't die!

Posted by "Herbert G. Fischer" <he...@trama.com>.
Any idea on how to fix this?

This problem is not hapening on SuSE PPC 7.3.


----- Original Message ----- 
From: "Herbert G. Fischer" <he...@trama.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, November 18, 2003 5:35 PM
Subject: [users@httpd] rotatelogs and cronolog don't die!


> Hi,
>
> I'm having the same problem on both Apache 2.0.47 and 2.0.48
> with both cronolog and rotatelogs. Both them are running on
> Slackware 9.1 with customized kernel.
>
> The problem is:
>
> When Apache starts, it starts all cronolog (or/and rotatelogs) "instances"
> correctly, but,
> when I stop Apache, all cronolog (or/and rotatelogs) instances remain
> running (not zombie).
> And starting Apache again, it starts another set of instances of cronolog
> (or/and rotatelogs),
> leaving a lot of cronologs running on the system.
>
> []s,
>
> Herbert
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org