[CentOS] named & rndc

Stephen Harris lists at spuddy.org
Sat Sep 22 14:16:41 UTC 2007


On Sat, Sep 22, 2007 at 09:44:20AM -0400, Peter Arremann wrote:
> Because restart executes stop and then start. Even if the process has been 
> killed, there may be other things like lock files, shared memory segments and 
> so on around that will be properly removed by stop. Therefore using restart 
> instead of start is a correct and good practice. 

No.

Depending on the rc script it _might_ be safe. In other cases it could
be insanely dangerous.  Take, for example, the following "stop" code...

   kill -9 `cat /var/run/myapp.pid`

What if "myapp" has died but left the pid file behind?  Another process
could have that process ID.  You've now killed some innocent defenseless
program.

(oh look... /etc/init.d/pcmcia...)

So... your procedure is _probably_ safe, there's no way it can be called
"good practice" and definitely not "correct".

-- 

rgds
Stephen



More information about the CentOS mailing list