dhcpd.log file not rolling
Glenn Satchell
glenn.satchell at uniq.com.au
Fri Jan 14 03:23:24 UTC 2011
That's right. dhcpd talks to (r)syslog, so no need to restart dhcpd -
need to refresh (r)syslog so that it talks to the new log file.
Have a look at the file that does the rotations for messages, named,
etc, and add the appropriate syslog command there. Maybe something like
"pkill -HUP rsyslog" since restarting syslog will interrupt logging
briefly for all services.
By (r)syslog, I mean rsyslog or syslog as appropriate for your OS, not
just RH6.
regards,
-glenn
On 01/12/11 08:20, jim wrote:
> Peter and Gene,
>
> Thanks for the replies, your input has fixed me up.
> Looking in to syslog-ng
> The "keeps its file descriptors open" got me to review more and I see I
> needed to add to /etc/logrotate.d/dhcpd
>
> /sbin/service rsyslog restart > /dev/null
>
> This got me going, now rolling the log file as expected.
>
> thanks!
>
>
> On Tue, Jan 11, 2011 at 9:16 AM, Peter Rathlev <peter at rathlev.dk
> <mailto:peter at rathlev.dk>> wrote:
>
> On Tue, 2011-01-11 at 08:36 -0500, jim wrote:
> > Upgraded to Red Hat Enterprise 6 and DHCP Server 4.1.1-P1 last week
> > and having a problem with the rolling of the dhcp.log file.
> >
> > Creates the new file dhcpd.log but dhcp sometimes is still
> putting the
> > log messages in the wrong/old file.
> > Creates the new file at 4:00 AM like on the old system, but the log
> > messages are still going in to the file dhcpd.log-20110110 for couple
> > of days.
>
> Can you see when the currently running dhcpd was started? What is the
> path to the running dhcpd executable?
>
> It seems that the running dhcpd somehow isn't restarted, and it thus
> keeps its file descriptors open.
>
> ...
> > In the file /etc/logrotate.d/dhcpd have
> > /var/log/dhcpd.log {
> > daily
> > rotate 60
> > missingok
> > create 0644 root root
> > postrotate
> > /sbin/service dhcpd restart > /dev/null
> > endscript
> > }
>
> I'm not familiar with RHEL 6, but if your 4.1.1-P1 is compiled from
> source it's probably placed under /usr/local/sbin/ instead
> of /usr/sbin/. And the "service" script might point at /usr/sbin/dhcpd
> (look in /etc/init.d/dhcpd).
>
> Otherwise you could remove the "> /dev/null" from the postrotate script
> to maybe see some kind of error.
>
> --
> Peter
More information about the dhcp-users
mailing list