firstboot: make rc-local start after cloud-init
The change is required because the cloud-init user (centos, ubuntu, cloud-user, ...) is used in the firstboot code. All distributions where vanilla can be deployed are based on systemd. Story: 2004479 Task: 28194 Change-Id: I9d8a626b84d5d3c2a91348895cded5fd32ded52a
This commit is contained in:
parent
9851391c28
commit
578cb4824b
|
@ -121,6 +121,17 @@ else
|
|||
RC_SCRIPT_DIR="/etc/rc.d"
|
||||
fi
|
||||
|
||||
# Make sure that rc-local.service starts after cloud-init.service,
|
||||
# so that the cloud-init user (centos, ubuntu, cloud-user, ...)
|
||||
# is available. See also:
|
||||
# https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1468103
|
||||
# All version of distributions affected by this change use systemd.
|
||||
mkdir -p /etc/systemd/system/rc-local.service.d/
|
||||
cat >/etc/systemd/system/rc-local.service.d/override.conf <<EOF
|
||||
[Unit]
|
||||
After=cloud-init.service
|
||||
EOF
|
||||
|
||||
install -D -g root -o root -m 0755 $(dirname $0)/firstboot $RC_SCRIPT_DIR/rc.local
|
||||
# make sure it is run, be it on SysV, upstart, or systemd
|
||||
chmod +x $RC_SCRIPT_DIR/rc.local
|
||||
|
|
Loading…
Reference in New Issue