Bug in sshd bootscript

Debian User joh at acentec.de
Fri Jan 17 00:51:42 PST 2003


On Thu, Jan 16, 2003 at 08:01:39PM -0600, Larry Lawrence wrote:
> On Thu, 16 Jan 2003 12:37:39 +0000, Jochen Held wrote:
> 
> > I couldn't reload sshd configuration with "/etc/rc.d/init.d/sshd reload"
> > in my LFS 4.0-RC1 based system.
> > SSH is a OpenSSH-3.5p1. 
> > 
> > The SSH daemon crashs with following message in /var/log/auth.log:
> > 
> > Jan 16 13:14:07 sesam sshd[119]: RESTART FAILED: av[0]='sshd', error:
> > No such file or directory.
> > 
> > So I change all occurences of "sshd" in /etc/rc.d.init.d/sshd to
> > "/usr/sbin/sshd" and all works fine.
> 
> The file /etc/rc.d/init.d/functions sets the path by being sourced into
> sshd with "source $rc_functions".  Your error messages imply that your
> path is correct when invoking sshd.  I suspect a typo in your scripts.
> 
							       
> Larry

I only "copy and paste" the scripts from BLFS-Book and it seems the path
isn't the problem in lfs-bootscripts but in sshd.

sshd.c:
/*
 * Called from the main program after receiving SIGHUP.
 * Restarts the server.
 */
static void
sighup_restart(void)
{
	log("Received SIGHUP; restarting.");
	close_listen_socks();
	close_startup_pipes();
	execv(saved_argv[0], saved_argv);
	log("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
	    strerror(errno));
	exit(1);
}

If sshd is invoked as "sshd" it can't find it's executable at restart.
Does it clear it's environment ?

So I think it's not a bug in blfs-bootscripts but a feature in OpenSSH :).

Can anyboby reproduce this behavior ?
And what's the best fix, patch the script or OpenSSH ?

Jochen
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list