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:
Luigi Toscano 2018-11-30 23:20:01 +01:00
parent 9851391c28
commit 578cb4824b
1 changed files with 11 additions and 0 deletions

View File

@ -121,6 +121,17 @@ else
# 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:
# 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
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