Hey there,
Waser recently pointed out that UnrealIRCd’s log directive in the unrealircd.conf configuration file is lacking. He also pointed out that any log file configured in unrealircd.conf doesn’t save the original log file before rotating to the new one. My guess for the latter is that log rotation should be handled via the logrotate utility or some other means, however, I disagree.
I completely understand the reasoning behind this but I think it would’ve been nice to automatically save the original log file, instead of completely truncating it. I also feel that the log directive should be a bit more configurable.
Therefore this patch was conceived and I’m releasing it to the public as-is. I’ve added a new option for the log directive, savepath, and now, when log files reach their maxsize, instead of losing the original log file, it’s now saved as log-filename.log.YYYYMMDDHHMM (e.g.; ircd.log.YYYYMMDDHHMM). The original log file will be saved to either the current directory the log file resides in or, if the savepath is defined, the IRCd will attempt to save it there, however, if it can’t, it’ll be saved in the current directory the log file resides in.
There’s an example unrealircd.conf in the tarball along with a README and the necessary patches. You’ll need to recompile the IRCd once the files have been patched. Originally, I wanted to write a module but given time constraints to learn the API and find in-depth documentation, I simply modified UnrealIRCd itself.
This code is released under no license, therefore I take no responsibility/liability for any mishaps (there should be none) that this may cause. The patch is provided as-is.
However, if you find bugs, have suggestions, comments, etc, feel free to drop by irc.nixsecurity.org and join #php.
Enjoy.
2 Trackbacks / Pingbacks for this entry
June 23rd, 2010 on 4:55 am
[...] neue Log-Dateien erstellt werden. Das Team von NixSecurity hat dafür aber bereits einen Patch entwickelt, bei dem man einen bestimmten Pfad zum Speichern der Logs einstellen kann und welcher dann beim [...]
June 25th, 2010 on 8:04 am
[...] Traduction francaise du texte original sur le site : http://nixsecurity.org/?p=121 [...]