On Mon, Oct 6, 2014 at 2:09 PM, Tor Houghton <t...@bogus.net> wrote:
> Hi,
>
> Dumb question: I'm running 'sudo ntpd -s' as part of a remote command to an
> OpenBSD guest[*]; unless I add a 'pkill sshd' to the end of the remote
> command, e.g.
>
>   ssh guesthost 'sudo pkill -9 ntpd && sudo ntpd -s && date && pkill sshd'
>
> the ssh connection won't disconnect. Why is this ('sudo ntpd -s' by itself,
> in a shell, returns a prompt)?

By itself, one of the ntpd daemons will keep open the stdin/out/err it
was started with, which in this case will be the pipe or tty created
by of the ssh server.

The easiest solution (if there isn't a virtualbox toolset) is to use
the rc.d framework, which will handle the fds:
    ssh guesthost '/etc/rc.d.ntpd restart'

and put the -s in ntpd_flags in rc.conf.local


Philip Guenther

Reply via email to