in reply to Rotating Log Files
Nevermind shorter/quicker, this will not work properly for any processes that keep an open file descriptor to their log file (i.e. almost every daemon process), because the fd will still point at the original inode and therefore keep logging to the now rotated file. For most daemons you need to send a SIGHUP to the parent process to reinitialise the logging. Take a look at the logrotate documentation and code for more details on this. That does not invalidate your code (it obviously still works for other processes), just thought I'd mention it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Rotating Log Files
by aukjan (Friar) on Dec 28, 2005 at 12:20 UTC | |
by tirwhan (Abbot) on Dec 28, 2005 at 12:41 UTC | |
by aukjan (Friar) on Dec 28, 2005 at 13:54 UTC |