rc.local editing wrong.

Bug #1089668 reported by Kevin Fox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Davanum Srinivas (DIMS)
Folsom
Fix Released
Low
Vish Ishaya

Bug Description

We are using Oz to create images for OpenStack.

We add some stuff to the end of rc.local so that it executes on boot.

the last few lines were something like:
if ....
  ...
fi

when nova boots the instance under folsom, which use to work under essex, rc.local became:
if ...
  ...
fi#!/bin/sh
# Added by Nova to ensure injected ssh keys have the right context
restorecon -RF /root/.ssh/ 2>/dev/null || :

which bash fails on because fi#!/bin/sh is apparently not valid

As a temporary workaround, I put an echo line right after the fi and things work again.
if ...
  ...
fi
echo done

Becomes:
if ...
  ...
fi
echo done#!/bin/sh
# Added by Nova to ensure injected ssh keys have the right context
restorecon -RF /root/.ssh/ 2>/dev/null || :

I think that that nova probably needs to insert a new line first whenever appending to rc.local instead of creating a new file.

Changed in nova:
assignee: nobody → Davanum Srinivas (dims-v)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/17997

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/17997
Committed: http://github.com/openstack/nova/commit/f393a513d7894ddb800e4dfc87da896600fb7421
Submitter: Jenkins
Branch: master

commit f393a513d7894ddb800e4dfc87da896600fb7421
Author: Davanum Srinivas <email address hidden>
Date: Wed Dec 12 21:11:06 2012 -0500

    Ensure we add a new line when appending to rc.local

    When we add content to rc.local, if the file already
    exists then we need to make sure we add the content
    after a new line explicitly

    Fixes LP #1089668

    Change-Id: I35be1496703b302f732363fa76ce832505eed599

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/23054

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/23054
Committed: http://github.com/openstack/nova/commit/8289d6c7834415878ae7524e8a718abbce49a1b0
Submitter: Jenkins
Branch: stable/folsom

commit 8289d6c7834415878ae7524e8a718abbce49a1b0
Author: Davanum Srinivas <email address hidden>
Date: Wed Dec 12 21:11:06 2012 -0500

    Ensure we add a new line when appending to rc.local

    When we add content to rc.local, if the file already
    exists then we need to make sure we add the content
    after a new line explicitly

    Fixes LP #1089668

    Change-Id: I35be1496703b302f732363fa76ce832505eed599
    (cherry picked from commit f393a513d7894ddb800e4dfc87da896600fb7421)

Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-2 → 2013.1
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.