[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Just passing by to see if anything has changed. Would be good to know if the workaround is effective for those affected. -- You received this bug notification because you are a member of Ubuntu Server, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Upstream server about using IP_FREEBIND: https://bugzilla.mindrot.org/show_bug.cgi?id=2512 ** Bug watch added: OpenSSH Portable Bugzilla #2512 https://bugzilla.mindrot.org/show_bug.cgi?id=2512 ** Also affects: openssh via https://bugzilla.mindrot.org/show_bug.cgi?id=2512 Importance: Unknown Status: Unknown -- You received this bug notification because you are a member of Ubuntu Server, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Under systemd, if the ListenAddress is on an interface that is manually brought up, the ifup script doesn't help. In that situation, the invoke- rc.d reload/restart fails because the initial startup of sshd wasn't successful. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Since so many things changed since this - admittedly embarrassing old - bug was reported I thought I retest it before the next LTS comes out. I looked at the Xenial content and found stuff like: Not only is it specified "After network.target", but on top there is /etc/network/if-up.d/openssh-server which is intended to restart openssh if later an iface comes up, there it would be able to rebind that IP. I tested on containers first and it worked right away, setting ListenAddress and restarting. But well in containers devices might be "up" at a different timing, but even in a KVM Guest, setting ListenAddress again it works just fine. Mar 24 14:54:43 testxenial-ssh sshd[1293]: Server listening on 192.168.122.131 port 22. I wondered and wanted to make sure that the test is valid, so I spawned trusty (LTS), vivid (last reported issue) and wily But - for me - it was working on all of them - even with several retries it was not even racy. Therefore I wanted to ask for a retest - at least with Xenial if possible. Also any detail about the test environment that was used would be great - especially by the last confirmation in vivid. Does it have to be a special network card that might initialize slowly or anything like it? -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Would be nice if it was fixed once for all. This is a critical bug when your server is in a distant location, and you cannot log on it because of that bug. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
** Tags removed: systemd-boot -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Changing the ssh service file to use network-online.target should also work; see http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ for more information. ** Tags added: systemd-boot -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
Re: [Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Wouldn't it be possible to have sshd use "IP_FREEBIND" so that it can bind an IP that has not materialized yet? -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
same in vivid Mai 11 12:40:44 pcds systemd[1]: Unit ssh.service entered failed state. Mai 11 12:40:44 pcds systemd[1]: ssh.service failed. Mai 11 12:40:44 pcds systemd[1]: ssh.service holdoff time over, scheduling ...t. Mai 11 12:40:44 pcds systemd[1]: start request repeated too quickly for ssh...ce Mai 11 12:40:44 pcds systemd[1]: Failed to start OpenBSD Secure Shell server. Mai 11 12:40:44 pcds systemd[1]: Unit ssh.service entered failed state. Mai 11 12:40:44 pcds systemd[1]: ssh.service failed. For the first time this error was reported 7 years ago. And it lives on and on and on ... -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
same problem with package openssh-server of Ubuntu 13.10 (Saucy) error messages in /var/log/auth.log after boot process: Nov 1 17:31:46 pc sshd[1209]: error: Bind to port xxx on yyy.yyy.y.y failed: Cannot assign requested address. Nov 1 17:31:46 pc sshd[1209]: fatal: Cannot bind any address. reason: /etc/ssh/sshd_config uses ListenAddress option solution: in /etc/init/ssh.conf change line start on runlevel [2345] to start on runlevel [2345] and net-device-up IFACE!=lo message in /var/log/auth.log after boot process now: Nov 1 17:39:20 pc sshd[1518]: Server listening on yyy.yyy.y.y port xxx. What needs to be done, so that the solution will get into the package? Could anybody help? -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
** Patch added: "ubuntu 12.10 patch /etc/init/ssh.conf without sleep" https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+attachment/3889510/+files/ssh.conf_12.10.patch -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
I tested on 12.10. Unfortunately the solution from Claus interferes with the network manager. On my 12.10 system I wasn't able to handle the eth0 by the network manager any more. As I don't like arvitrary sleep times, I figured out a solution just changing the start on line in /etc/init/ssh. It works very well for me in 12.10.. I add this patch in a moment. It would be fine if someone would test it and confirm it. Users of other ubuntu versions might have to change the line accordingly. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
I have fixed this problem for me in /etc/network/interfaces auto eth0 iface eth0 inet dhcp up service ssh start -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Three years and six releases later, this is still present :( -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to the bug report. https://bugs.launchpad.net/bugs/216847 Title: sshd will not start at boot if ListenAddress is set, because network interface is not yet up To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/216847/+subscriptions -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
Adding random sleeps is usually not the best possible solution, as the required delay varies between systems (for example, when using a network bridge). Maybe depending on net-device-up would be better. -- 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
** Tags added: 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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
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
[Bug 216847] Re: sshd will not start at boot if ListenAddress is set, because network interface is not yet up
** Summary changed: - sshd will not start at boot + sshd will not start at boot if ListenAddress is set, because network interface is not yet up ** Visibility changed to: Public -- 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