Subject: Re: restarting chrooted named from remote
To: None <netbsd-users@netbsd.org>
From: Christoph Kaegi <kgc@zhwin.ch>
List: netbsd-users
Date: 09/18/2003 10:11:03
On 17.09-10:49, Tim Bandy wrote:
> >>>>> "Christoph" == Christoph Kaegi <kgc@zhwin.ch> writes:
>     Christoph>  On 16.09-14:24, Tim Bandy wrote:
>     Christoph> 
>     Christoph> I want to restart named9, running on a NetBSD-1.6.1
>     Christoph> machine by doing:
>     Christoph> 
>     Christoph> # ssh remote.machine "/etc/rc.d/named9 restart"
>     Christoph> 
>     Christoph> This basically works but the problem is, the ssh
>     Christoph> session never returns.
>     Christoph> 
>     Christoph> Does anyone have an idea, why this could be?
>     Christoph> 
> 
> Actually, I think that http://www.openssh.org/faq.html#3.11 is the
> appropriate faq.  My bad.  Hopefully you found that.

Yes, found that :-)

> 
> Now, in light of that, I completely agree with you.  In fact, I just
> logged into one of my boxen and killed cron, then did this:
> 
> % ssh root@host /usr/sbin/cron
> %
> 
> Of course, it returned as soon as it had finished starting cron, and
> exited as it should.  So perhaps it's something with bind9 or
> /etc/rc.d/named9, neither of which I have on my netbsd box.  BTW, I
> did set up bind8, and was able to duplicate my results with cron using
> /usr/sbin/named.  What are the contents of /etc/rc.d/named9?  Can you
> run bind9 by itself and have ssh exit as it should without using
> /etc/rc.d/named9?

I had the same effects, using /etc/rc.d/named9 or /usr/local/sbin/named.

But i have it solved now. The ssh command that works is:

  # ssh -t host "/etc/rc.d/named9 restart; sleep 2"

Maybe anyone can explain, why the -t and the sleep 2 is needed? 

Chris

-- 
----------------------------------------------------------------------
Christoph Kaegi                                           kgc@zhwin.ch
----------------------------------------------------------------------