Hello! After noticing a 80MB babeld logfile on my router, I figured I would implement log rotation for it. Unfortunately, it turns out that babeld exits when it receives SIGHUP, the default signal delivered by log rotation software (at least newsyslog in FreeBSD and logrotate in Debian).
It is a very old tradition in UNIX daemons to use the SIGHUP signal for exactly that reason: reload your config files and reopen your logs! This seems to be what SIGUSR2 is doing to babel, and while I can adapt my configuration to do that, it seems more appropriate for Babel to follow usual standards. here's a patch.
From 0db1c35bcf7ea5fde37ef4f5dfe63c6a12bacfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <[email protected]> Date: Fri, 20 Sep 2013 20:10:21 -0400 Subject: [PATCH] properly reopen logfiles on SIGHUP, instead of exiting --- babeld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/babeld.c b/babeld.c index a871159..6135839 100644 --- a/babeld.c +++ b/babeld.c @@ -951,7 +951,7 @@ init_signals(void) sigaction(SIGTERM, &sa, NULL); sigemptyset(&ss); - sa.sa_handler = sigexit; + sa.sa_handler = sigreopening; sa.sa_mask = ss; sa.sa_flags = 0; sigaction(SIGHUP, &sa, NULL); -- 1.7.10.4
A.
PS: Ideally, there would also be a routine to reload the configuration,
but I couldn't find any, so this is not yet implemented.
--
Il n'existe aucune limite sacrée ou non à l'action de l'homme dans
l'univers. Depuis nos origines nous avons le choix: être aveuglé par
la vérité ou coudre nos paupières.
- [no one is innocent]
pgpy4tlSC48XK.pgp
Description: PGP signature
_______________________________________________ Babel-users mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

