From 9cd35c36e4a15fbaaa3f384bc9ea2422f877eef8 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 10 Feb 2016 13:47:18 +1100 Subject: [PATCH] Fix startup race with growroot/systemd Tucked away in systemd-udev-settle.service is the following comment # This service can dynamically be pulled-in by legacy services which # cannot reliably cope with dynamic device configurations, and # wrongfully expect a populated /dev during bootup. The info that the growroot script is querying is populated via udev, particularly the blkid bits of [1]. This creates a race-condition where sometimes udev has been triggered and the rules have applied and sometimes not. Obviously in the first case, the root disk is not grown correctly. systemd-udev-settle is mostly disabled on distros because it can cause an increase in boot-time for systems with lots of disks; this is not our situation so it makes basically no difference. That said, I will investigate if some systemd people know even better ways to do this (possibly the service should depend on block .device targets in systemd, and then filter out and only apply to the root disk?) [1] https://github.com/systemd/systemd/blob/master/rules/60-persistent-storage.rules#L66 Change-Id: I453e3afcd953dfc29ab6c42ddc81e940cfa70ee0 --- elements/growroot/init-scripts/systemd/growroot.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elements/growroot/init-scripts/systemd/growroot.service b/elements/growroot/init-scripts/systemd/growroot.service index 40093d99..9d8ed963 100644 --- a/elements/growroot/init-scripts/systemd/growroot.service +++ b/elements/growroot/init-scripts/systemd/growroot.service @@ -1,6 +1,7 @@ [Unit] Description=Grow root partition -After=local-fs.target +Wants=systemd-udev-settle.service +After=systemd-udev-settle.service [Service] Type=oneshot