Re: Sometimes multilog rotates the logfile when receiving a sigterm
Rodrigo Campos <[email protected]> Fri, 28 Aug 2009 14:36:05 -0300
| Newsgroups | gmane.comp.djb.syslog |
|---|---|
| Message-ID | <[email protected]> |
2009/8/28 Daryl Tester <[email protected]>: > (* Reply to /dev/null'd *) > > Rodrigo Campos wrote: > >> Also, I'm seeing that the logs are rotated without getting to the size >> specified, and an ALRM signal is never sent to it. > > Are the logs rotated to *.s files with 744 permissions, or *.u files with > 644 permissions? .u files with 644 > What are the permissions on ./test/current when multilog > has "terminated"? On the directory ? drwx------ > >> If I kill it using ctrl+c or just "kill <pid>" it sometimes rotates >> the file (besides its way low the size it should be). > > Depending on your shell, ^C goes to the process group, so multilog will > receive a SIGINT which I don't believe it traps (and therefore would > terminate abnormally). I don't know about your "kill", except that if > multilog terminated abnormally previously (denoted by the permissions on > current) it will rotate current to a *.u filename when multilog runs the > next time. I see the file rotated without running it a next time. Could this be caused be something else ? > >> Does anyone know how to avoid this or if it is possible to avoid it ? > > multilog isn't traditionally run from the command line. If you > honestly have a requirement to do this, run something that will > run a setpgrp() prior to running multilog so that it shouldn't > receive signals sent to the process group and should therefore > terminate normally when the pipe closes. But if I do "kill <pid>" where pid is the pid of the program, it should not affect multilog, shouldn't it ? Also it should not matter if the program segfaults ? or that perhaps could affect it ? Thanks a lot, Rodrigo