Re: Strange behaviour in logging files and log rotatation, hopefully an easy answer?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/17/05, Paul Howarth <paul@xxxxxxxxxxxx> wrote:
> Bob Brennan wrote:
> > On 5/17/05, Paul Howarth <paul@xxxxxxxxxxxx> wrote:
> >>>You need to get the server to close the log file and reopen it (which
> >>will access the new file). This is usually done by using a "postrotate"
> >>script in logrotate that sends an appropriate signal to the server. For
> >>example, in the standard FC3 httpd logrotate file, there is:
> >>
> >>     postrotate
> >>         /bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2>
> >>/dev/null || /bin/true
> >>     endscript
> >
> >
> > Thanks Paul - looking in my own logrotate file for httpd I find:
> > "/bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true"
> > as the postrotate command, nearly the same as your line except for the
> > /bin/true part.
> >
> > I will put that postrotate command into my less critical site's
> > logrotate files and see what happens over the next few days, then put
> > it into all logrotates that exhibit the problem.
> 
> The "|| true" probably won't make any difference; it just keeps
> logrotate happy that the script has run, even if there's been an error.
> 
> Are you sure that /var/run/httpd.pid has the PID of your httpd process?

$ pidof httpd
19554 19305 19212 19208 19186 19180 19054 19006 15738 3888

/var/run/httpd.pid has only "3888" in it

is this correct?

bob


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux