sshd can start before cloud-init injects keys

Bug #1333920 reported by Jordan Evans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned

Bug Description

Description of problem:

When using automated scripts for deployment, many wait for sshd to come up, then ssh in. Since cloud-init and sshd are started in parallel, this creates a race condition for cloud-init to add ssh keys before sshd starts or the user can't login and the automated scripts can fail.

Specifically, this is happening to me using test-kitchen with the kitchen-openstack plugin, which uses Fog. It calls wait_for and watches for sshd to come up. It catches sshd before cloud-init finishes installing keys, and fails to ssh.

Reproducing:

Attempt to ssh in before cloud-init finishes but after sshd is up and running.

Steps to Reproduce:
1. Pull in Fedora Cloud image for OpenStack
2. Configure test kitchen to use Fedora
3. Run test-kitchen tests

Actual results:

ssh fails, which causes test-kitchen or other automated scripts to fail.

Expected results:

ssh should succeed.

This is specifically affecting me on Fedora-20, but can potentially affect any distribution using systemd.

Related branches

Revision history for this message
Scott Moser (smoser) wrote :

fix committed in revno 995.

Changed in cloud-init:
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

fixed in 0.7.6

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.