summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'systemd')
-rwxr-xr-xsystemd/cloud-init-generator5
1 files changed, 5 insertions, 0 deletions
diff --git a/systemd/cloud-init-generator b/systemd/cloud-init-generator
index 2d319695..fedb6309 100755
--- a/systemd/cloud-init-generator
+++ b/systemd/cloud-init-generator
@@ -6,6 +6,7 @@ DEBUG_LEVEL=1
LOG_D="/run/cloud-init"
ENABLE="enabled"
DISABLE="disabled"
+RUN_ENABLED_FILE="$LOG_D/$ENABLE"
CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target"
CLOUD_TARGET_NAME="cloud-init.target"
# lxc sets 'container', but lets make that explicitly a global
@@ -107,6 +108,7 @@ main() {
"ln $CLOUD_SYSTEM_TARGET $link_path"
fi
fi
+ : > "$RUN_ENABLED_FILE"
elif [ "$result" = "$DISABLE" ]; then
if [ -f "$link_path" ]; then
if rm -f "$link_path"; then
@@ -118,6 +120,9 @@ main() {
else
debug 1 "already disabled: no change needed [no $link_path]"
fi
+ if [ -e "$RUN_ENABLED_FILE" ]; then
+ rm -f "$RUN_ENABLED_FILE"
+ fi
else
debug 0 "unexpected result '$result'"
ret=3