I'm having this exact symptom but in a different environment:   Ubuntu
10.04 Lucid Server.

After configuring /etc/ssh/sshd_config to have a specific ListenAddress
instead of 0.0.0.0, the ssh daemon consistently fails to start at boot
time.    Errors from /var/log/auth.log:

Sep 23 14:26:45 a02-gsp sshd[697]: error: Bind to port 22 on 10.100.50.19 
failed: Cannot assign requested address.
Sep 23 14:26:45 a02-gsp sshd[697]: fatal: Cannot bind any address.

And errors in /var/log/syslog immediately after boot:

Sep 23 14:26:45 a02-gsp init: ssh main process (739) terminated with status 255
Sep 23 14:26:45 a02-gsp init: ssh main process ended, respawning
Sep 23 14:26:45 a02-gsp init: ssh main process (744) terminated with status 255
Sep 23 14:26:45 a02-gsp init: ssh respawning too fast, stopped

So this appears to be the same problem, but the root cause would seem to
be upstart in this case.    Since /etc/init/ssh.conf says "start on
filesystem", sshd is started before the network interfaces are
configured and fails to bind to the specific address that isn't
configured yet.

I've implemented the following workaround which seems to be working
well:   changed the start event in ssh.conf to "start on started
network-interface" and added a "sleep 3" in the pre-start script (see
attached patch).   Without the sleep to wait for the interface to be
configured, sshd would still fail to start some of the time.

If this would be more appropriate as a new bug specific to Lucid Server
I'll be happy to open a new one.



** Patch added: "patch with my changes to /etc/init/ssh.conf"
   
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+attachment/1629304/+files/ssh.conf.patch

-- 
sshd will not start at boot if ListenAddress is set, because network interface 
is not yet up
https://bugs.launchpad.net/bugs/216847
You received this bug notification because you are a member of Ubuntu
Server Team, which is a direct subscriber.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to