Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2004 17:55:46 +0200
From:      Roman Neuhauser <neuhauser@chello.cz>
To:        James Housley <jim@thehousleys.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Loosing STDOUT after file rotation
Message-ID:  <20040402155546.GB14408@isis.wad.cz>
In-Reply-To: <406C8F4F.1040306@Thehousleys.net>
References:  <406C8F4F.1040306@Thehousleys.net>

next in thread | previous in thread | raw e-mail | index | archive | help
# jim@thehousleys.net / 2004-04-01 16:53:19 -0500:
> I have a program that I have the is supposed to run forever.  I log any 
> output to a log file.  It is run in a startup script like thie:
> 
> program_name >> $err_log 2>&1
> 
> The problem is that after newsyslog rotates the $err_log file, no more 
> data is written to the file.  I can not stop and restart the program.  I 
> can accept a signal.  But what do I need to do in "program_name" to allow 
> the data to be written after the "rotation" of the file.

    the program still writes to the original file. file != filename.
    you need to have newsyslog send the daemon a signal; the program
    needs to reopen the path in the signal handler.

-- 
If you cc me or remove the list(s) completely I'll most likely ignore
your message.    see http://www.eyrie.org./~eagle/faqs/questions.html



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040402155546.GB14408>