Date: Tue, 10 Feb 1998 05:33:46 -0200 (EDT) From: Joao Carlos Mendes Luis <jonny@coppe.ufrj.br> To: hackers@FreeBSD.ORG Subject: logrotate, a proposal Message-ID: <199802100733.FAA03915@gaia.coppe.ufrj.br>
next in thread | raw e-mail | index | archive | help
--ELM887096026-3830-0_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, I could not sleep, so I went hacking. :) I have modified newsyslog.c to create the logrotate. The sources are attached. If some commiter think it has enough quality to be integrated, please do so. I tried not to make many changes to the original sources. In fact, the rotate function is just the same (except for minor bugs) as the one in newsyslog.c. Maybe it's useful to make them a crunched program, but I did not bother doing it this way. During the conversion, I found the following (cosmetic) bugs in newsyslog: 1) getopt receives and argument for a -t flag, but it's not used. 2) If newsyslog is not setuid, shouldn't it be owned by bin.bin ? 3) printf lack a \n at the "Start new log..." message, and at the "chmod ..." message, right below. 4) The rotate algorithm is not very smart. Maybe it should be rewritten. Jonny -- Joao Carlos Mendes Luis jonny@gta.ufrj.br +55 21 290-4698 jonny@coppe.ufrj.br Universidade Federal do Rio de Janeiro UFRJ/COPPE/CISI PGP fingerprint: 29 C0 50 B9 B6 3E 58 F2 83 5F E3 26 BF 0F EA 67 --ELM887096026-3830-0_ Content-Type: application/x-gtar Content-Disposition: attachment; filename=logrotate.tgz Content-Description: New utility for FreeBSD 2.2-stable Content-Transfer-Encoding: base64 H4sIAM4B4DQCA+1a61fbRhbnK/orbpwm2EQI2zwDJWcdAon3AOZgsk2b5FBZGtsqtqSjBw60+d/3 d2ckWfKDPNjmQ9fTUyyP7mvu+44z8HqBF5mRWF/62xZtVne2tmiJiGqbm/KTtuvqU60qNjZ3qljb O1uAqtW3N5Zoa+kHrDiMzIBo6Q/PdW/vgbOc0Fn6561BZv9T81p0nYH43/OowayJ3Wfaf7Mq7b+9 s7OzvbW1A6iNah32ry7s/7evx8s/Ne09So2v31DNqFPt+fPt9WptvbZNtereRn2vWiOpIDr65NNP mnZ+0Xp9sJw5j6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aLqyl2E YdfzhSuVWzL5ogHN8Nnbk5NpJanZr7yW7z3SIa/LHQ2nnmy6e//E/riXTnX5k8wsZMkdkE7jG5cy CFfQdPvcc0/aPAknKe1R63ha2NStU0XtkcLZyztycqKqGjD5pwD+XR7zxdQPBRwFhX8zkOZ8ebqx baZv8L7KQNk4mR8ZU+Bo6L+v1Xdzc1v24MvJpAupyzOmgsQ2wJf9ZnXSjVmTTGFmgk0VyMSnMrpM WT4zmdsbi0/CGpQLP8DohR9K9NJat6SzcNVZoaXYF/AnImhpsRZrsRZrsRZrsRZrsRZrsRZrsRZr sRZrsRZrsRZrsRZrsRZrsRZrsRZrsf5x678ESr8AAFAAAA== --ELM887096026-3830-0_-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802100733.FAA03915>