[Samba] SOLVED Re: NT_STATUS_CONNECTION_REFUSED

Bob of Donelson Trophy bob at donelsontrophy.net
Thu Feb 26 05:25:55 MST 2015


 

I agree with both of you. 

Louis, 

Seemed logical that in some instances bind9 did (or does not) not
shutdown as instructed in line 190-whatever (don't remember exact line
number, but . . .) 

And so, 

My thinking (late last night) was an insertion into the script that
"asked" if bind9 is running and if so then "service bind9 stop" to stop
it. Rowland, you made your suggestion. 

When I ran the modified script on the VM and there were no
"NT_STATUS_CONNECTION_REFUSED" warnings near the end of the script run.
My mods were simple but satisfied my need. Rowland script idea is wiser
and better covers the "what if" scenario if bind9 didn't stop as
instructed at line 190-ish. 

It can be difficult to predict all the "what if" scenarios a script may
encounter. 

---

-------------------------

Bob Wooden of Donelson Trophy

615.885.2846 (main)
www.donelsontrophy.com [1]

"Everyone deserves an award!!"

On 2015-02-26 02:55, Rowland Penny wrote: 

> On 26/02/15 08:15, L.P.H. van Belle wrote:
> aha ... ;-) netstat --numeric-hosts --numeric-ports --programs -u -t -l i didnt see samba running.. ;-) I removed the "service bind9 stop &&" from line 449 (as bind9 was already stopped, why stop it again) and ran the script on my VM. All the "NT_STATUS_CONNECTION_REFUSED" warnings were gone. but.. the NT_STATUS_CONNECTION_REFUSED is a samba message not bind, and does not involve any thing with bind, stopping it 2 x times does not do anything.. The service bind9 stop && service bind9 start was the problem yes, I should have put these on 2 lines and dont use the && this wil be changed in the new version and improved.

Ah, but the '&&' means that bind9 would only get started if the command
on the left finished without an error and as it errored out because
there was nothing to stop.......

> Im stopping bind there 2 times yes, this is because i noticed that a few times bind wasnt stopped correctly, and stopping it 2 times worked.

If there is a potential problem, you should check for it and if
required, do something, what about:

BINDTEST=$(ps ax | grep [n]amed)
if [ -n "${BINDTEST}" ]; then
 # Bind9 is still running
 service bind9 stop
 sleep 2
 service bind9 start
else
 # Bind9 is not running
 service bind9 start
fi

Rowland

> But good to know you nailed it. ;-) Greetz, Louis
 

Links:
------
[1] http://www.donelsontrophy.com


More information about the samba mailing list