sshd is not restarted properly on libc6 upgrades

Bug #709468 reported by Clint Byrum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
New
Undecided
Unassigned

Bug Description

The logic that libc6 uses to restart services on libc6 upgrade involves calling invoke-rc.d $service restart.

invoke-rc.d is totally upstart unaware, and relies entirely on upstart job files being symlinked to /lib/init/upstart-job

ssh is unique in that its init.d script has been kept, untouched, to enable use/testing in chroots.

The problem is, this means that on libc6 upgrade, we actually start a new sshd:

Jan 28 11:41:50 lucid sshd[1499]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 28 11:41:50 lucid sshd[1499]: error: Bind to port 22 on :: failed: Address already in use.
Jan 28 11:41:50 lucid sshd[1499]: fatal: Cannot bind any address.
Jan 28 11:41:50 lucid sshd[1502]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 28 11:41:50 lucid sshd[1502]: error: Bind to port 22 on :: failed: Address already in use.
Jan 28 11:41:50 lucid sshd[1502]: fatal: Cannot bind any address.
Jan 28 11:41:50 lucid sshd[1505]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 28 11:41:50 lucid sshd[1505]: error: Bind to port 22 on :: failed: Address already in use.
Jan 28 11:41:50 lucid sshd[1505]: fatal: Cannot bind any address.

The parent just sits there waiting. Now this parent is reaped by /etc/init.d/sendsigs, but the main process managed by upstart is not. Even though it should be in the process of shutting down thanks to the fix for bug #603363 (not backported to lucid yet), it may not have stopped quite yet, so / fails the remount to readonly.

Suggested immediate fix is to have the init.d script actually check to see if the upstart job is running, and restart it instead.

Long term once the session support lands in upstart, this init.d script should be removed anyway.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ok, I've built the branch linked to this report in a PPA here:

https://launchpad.net/~clint-fewbar/+archive/fixes

Note that that PPA is full of other things that aren't dependencies of mysql, so be careful using the ppa, upgrades may break your box. :)

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Oops, wrong window.

Revision history for this message
Colin Watson (cjwatson) wrote :

There's at least one other bug suggesting that it would be good for the init.d script to be a little bit more Upstart-aware during this transition period. I think it would be a good idea, although evidence suggests that I'm failing to have time to implement it ...

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

This does in fact appear to be a duplicate of bug #531912 .. marking as such.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.