Re: multi-named instance exist?

2009-03-26 Thread Doug Barton
Rich Goodson wrote: > If you're really looking to cover all bases, there's a little gotcha in > Solaris (even in 10) that will make this startup script fail if it's > invoked with sh (as most startup scripts that I've seen are). Yeah, I was trying to avoid "shell portability" concerns to try to av

Re: multi-named instance exist?

2009-03-26 Thread Rich Goodson
If you're really looking to cover all bases, there's a little gotcha in Solaris (even in 10) that will make this startup script fail if it's invoked with sh (as most startup scripts that I've seen are). The 'test -e' is unavailable in sh on Solaris. You need to use -r (file exists and is r

Re: multi-named instance exist?

2009-03-26 Thread Chris Thompson
On Mar 26 2009, Kevin Darcy wrote: [...] The problems with using "ps" to find the named process include: -- you can get false matches if you don't tailor your string matching _just_right_, -- unexpectedly "missed" matches if the command-line arguments change, even a little bit (e.g. if someone

Re: multi-named instance exist?

2009-03-25 Thread Doug Barton
dev_n...@zoho.com wrote: > > > > If named is invoked successfully on startup, then the contents of the > > PID file will be overwritten with the new PID value. > > > > If named *isn't* invoked successfully on startup, then that's a separate > > error condition that should be detected an

Re: multi-named instance exist?

2009-03-25 Thread dev_null
> If named is invoked successfully on startup, then the contents of the > PID file will be overwritten with the new PID value. > > If named *isn't* invoked successfully on startup, then that's a separate > error condition that should be detected and dealt with, within the whole > sta

Re: multi-named instance exist?

2009-03-25 Thread Kevin Darcy
If named is invoked successfully on startup, then the contents of the PID file will be overwritten with the new PID value. If named *isn't* invoked successfully on startup, then that's a separate error condition that should be detected and dealt with, within the whole startup subsystem. The

Re: multi-named instance exist?

2009-03-25 Thread dev_null
I don't agree so much. some time when a system is reboot unnormally, named doesn't have the chance to remove its pid file. (when OS is shutdown normally, OS sends SIGTERM to named, named can exit and remove its own pid file.) after system is started, the pid number in name's pid file is maybe an

Re: multi-named instance exist?

2009-03-25 Thread Kevin Darcy
Standard methodology would be to read the contents of the PID file and see if that process is running (traditionally kill -0 $pid can be used to non-intrusively check whether a given process is running).

Re: multi-named instance exist?

2009-03-25 Thread dev_null
That's the good idea, I have written a script to archive that: start() { if ! ps -efw|grep 'named -u nobody'|grep -v grep >/dev/null 2>&1;then /usr/local/bind/sbin/named -u nobody fi } Thanks. > dev_n...@zoho.com wrote: > > Hello, > > > > I found a strange case on bind

Re: multi-named instance exist?

2009-03-25 Thread Kevin Darcy
dev_n...@zoho.com wrote: Hello, I found a strange case on bind server. when one named was running, I started another one or more (the same) named server again, they all got started successsfully. this is the ps output: nobody28312 1 0 10:10 ?00:00:00 /usr/local/bind/sbin/name

multi-named instance exist?

2009-03-25 Thread dev_null
Hello, I found a strange case on bind server. when one named was running, I started another one or more (the same) named server again, they all got started successsfully. this is the ps output: nobody28312 1 0 10:10 ?00:00:00 /usr/local/bind/sbin/named -u nobody nobody2835