About newsyslog behavior
Jim Xochellis
dxoch at escape.gr
Wed Jul 2 02:08:40 PDT 2003
Hi list,
I am using the newsyslog utility to turn over my log files
automatically. I have noticed that some processes have problem to
continue using their log file after newsyslog has turned it over and
need to receive the SINGHUP signal to re-start logging correctly.
However sending SINGHUP has uncomfortable consequences in some cases
(for instance when sending signal to netatalk, or other file servers
perhaps).
I suspected that some processes are confused because a *new* log file
is created and these processes are making the assumption that their log
file will be always the same and perhaps they open it once and then
work with the FILE pointer. (just a simple theory that explains some
facts) I have confirmed that newsyslog actually creates a new log file
(instead of copying it and then disposing its contents) by reading the
source of the newsyslog.c file and particularly the dotrim() function.
I have also tested that changing the contents of the log files by hand
does not affect the logging of most processes (surely not the logging
of netatalk).
Having the above in mind, isn't it worthwhile to add an option in
newsyslog in order to avoid the creation of a new log file when it is
inconvenient?
Isn't it feasible to dispose the contents of the old log file instead
of creating a new one?
Anything that I am missing here? (giving the fact that I am not a unix
guru, only a C programmer)
Thank you very much for your time
Jim Xochellis
More information about the freebsd-questions
mailing list