[cod] Log file rotation
chrislist at de-punkt.de
Tue Jan 27 16:02:06 EST 2004
VG Ops wrote:
> Has anyone had any problems with setting up log file rotation. If find
> that if I move the games_mp.log file (to say games_mp.1.gz) then CoD
> does not start a new games_mp.log and wont write to an empty
> games_mp.log put in its place (a touched file). In fact, the only way I
> seem able to get cod to start writing to the log is to restart the
> server. :-(
That is normal behavior for nearly all unix based applications. Since
files are internally represented as file descriptors which are typically
opened upon starting the application (here: the cod server) and closed
while shutting down the application, there is no way for the server to
know if the file has been moved away. If it has been removed and
retouched, the inode number has changed, and thus the file descriptor
has become stale. Apache has the nasty habit of completely breaking down
when this occurs, the CoD server only stops logging.
And since the CoD server probably doesn't support SIGHUP for refreshing
all file handles, you need to shut down the server before rotating the
log file and start it afterwards.
Again, this is not specific to the CoD server, it is normal behavior for
any application, including syslogd.
More information about the Cod