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
(cherry picked from commit 578cb4824b)
This commit is contained in:
Luigi Toscano 2018-11-30 23:20:01 +01:00
parent c46fb03166
commit 44b8115743
1 changed files with 11 additions and 0 deletions

View File

@ -115,6 +115,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