View Single Post
  #47   Report Post  
Posted to uk.d-i-y
Bob Eager[_3_] Bob Eager[_3_] is offline
external usenet poster
 
Posts: 534
Default That's hard work for an electrician.

On Wed, 30 Apr 2014 17:41:47 +0100, Alan Braggins wrote:

In article , Tim Streater
wrote:
In article ,
Martin Bonner wrote:
On Wednesday, April 30, 2014 9:14:22 AM UTC+1, Tim Streater wrote:
In article , The Natural Philosopher
wrote:

Now Emacs takes the original file adds a tilde to it an creates a
new one of the original name. Vi takes the old file and alters it.
Result is, if a process has the file open emacs doesn't actually
change the working file contents.

You haver to restart the whole daemon. Which he failed to do of
course.

Don't you have to do that anyway, however you edit it?

No. You send the daemon a SIGHUP and it rereads. If it rereads by
rewinding the existing filehandle and rereading (rather than reopening
the file name), the filehandle will be a handle to the *old* file.

I have to say, keeping the config file open seems barking to me.


That *is* barking.

And that presupposes that there *is* a way to send a SIGHUP. On Win7 I
couldn't find a way to do that for apache. So no obvious way to rotate
apache's log files.


TNP did say _Unix_ configuration files, even if what he meant was
apparently configuration files for one specific daemon which had barking
config file handling. Obviously well behaved daemons don't care what
editor you use.


On my FreeBSD systems, I use an editor that writes a fresh file, and I've
never had any problems. Apart from the cron daemin, which reads the file
so frequently it's probably best to keep it open.




--
Use the BIG mirror service in the UK: http://www.mirrorservice.org
My posts (including this one) are my copyright and if @diy_forums on
Twitter wish to tweet them they can pay me £30 a post
*lightning surge protection* - a w_tom conductor