On Wed, 15 Apr 2015 11:35:21 +0300 Ville Valkonen <weezeld...@gmail.com> wrote: > Hello, > > On 13 April 2015 at 15:10, dan mclaughlin <thev...@openmailbox.org> wrote: > > On Mon, 13 Apr 2015 16:49:02 +0530 Hrishikesh Murukkathampoondi > > <hris...@gmail.com> wrote: > >> Hello > >> > >> I am running OpenSD 5.6 on a x86 netbook. I am trying to setup X11 > >> forwarding in ssh. > >> > >> In sshd_config I have added > >> X11Forwarding yes > >> > >> In ssh_config I have added > >> ForwardAgent yes > >> ForwardX11 yes > >> > >> I have restarted sshd (pkill -HUP sshd) and when I start ssh from the > >> client using ssh -X I get DISPLAY is not set when trying to launch an > >> xterm. > > > > this is probably a bad idea. that will send the signal to all sshd > > processes, > > and not just the main server. > > > > the proper way to restart sshd is to use the pid in /var/run/sshd.pid ie > > > > $ kill -1 $(</var/run/sshd.pid) > > Noup, kill HUP is completely okay. Have a look: > $ uname -r > 5.6 > $ grep -A 2 rc_reload /etc/rc.d/sshd > rc_reload() { > ${daemon} ${daemon_flags} -t && pkill -HUP -f "^${pexp}" > } > > and for clarity: > $ grep pexp= /etc/rc.d/rc.subr |tail -1 > pexp="${daemon}${daemon_flags:+ ${daemon_flags}}" > > -- > Regards, > Ville >
well, my thinking was that i generally don't send signals to non-involved processes, but sshd is probably made to handle this well. this is in fact probably the better method. from sshd(8): /var/run/sshd.pid Contains the process ID of the sshd listening for connections (if there are several daemons running concurrently for different ports, this contains the process ID of the one started last). The content of this file is not sensitive; it can be world- readable. so my method may not work properly if there were multiple daemons running.