[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: daemon vs. savelog ???



<quote who="Michael D. Schleif">
>
>
> Actually, I was a bit misleading and this is running on an embedded
> system running slink, due to glibc size issues ;<
>
> savelog is already there and logrotate, my erstwhile favorite, is not.
> Yes, logger is available -- can it handle a stdout stream?  I really want
> its own logfile, too.
>
> Therefore, I am willing to shell script (ash ;<) some other rotational
> scheme.
>
> How do ``real'' daemon programs get around this issue?  Is it the kill
> -HUP $PID trick?  I've never been too comfortable with signals . . .

apache re-opens logs upon HUP signal, as does syslog-ng, many other
programs do i'm sure but I can't name more off the top of my head.
signals aren't completely foolproof, but its one of the few ways
to get a message to the process so it knows something is changed and
it reloads itself without terminating the process.

if possible, the next best thing i can think of is the shellscript,
do a manual log rotation, stop the process, rotate and start it
again. this IMO is more risky then sending a -HUP signal. I've
had processes(apache) run for months without a problem, then
I restart the system and find that it constantly segfaults because
of a library I changed. once i recompile the part of apache
with the new library all is well. but no problems until stopping
and starting the process.

something much more experimental may be involving netcat,
it may be possible to redirect output to netcat which sends it
over tcp/ip to somewhere which has a daemon that takes that info
and shoves it to a file(could even be localhost). then the remote
daemon could be stopped & started quickly for log rotation keeping
the main process alive. of course there would be security
issues with this method, since netcat doesnt really support any
kind of authentication i think.

nate






-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: