summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-10 10:41:48 -0500
committerScott Moser <smoser@ubuntu.com>2016-03-10 10:41:48 -0500
commitb1d9c92f5bc6f711e104ceb981ded658249c3255 (patch)
tree3feaa02dc34693c6f34cb6ea96d8853c080606a3 /systemd
parent2f29e70d99906dd7bff0c64109a77f609577f063 (diff)
downloadcloud-init-git-b1d9c92f5bc6f711e104ceb981ded658249c3255.tar.gz
generator: use /run/cloud-init instead of /run
Diffstat (limited to 'systemd')
-rwxr-xr-xsystemd/cloud-init-generator5
1 files changed, 3 insertions, 2 deletions
diff --git a/systemd/cloud-init-generator b/systemd/cloud-init-generator
index b7a2f17a..8156db58 100755
--- a/systemd/cloud-init-generator
+++ b/systemd/cloud-init-generator
@@ -3,7 +3,7 @@ set -f
LOG=""
DEBUG_LEVEL=1
-LOG_D="/run"
+LOG_D="/run/cloud-init"
ENABLE="enabled"
DISABLE="disabled"
CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target"
@@ -17,7 +17,8 @@ debug() {
[ "$lvl" -gt "$DEBUG_LEVEL" ] && return
if [ -z "$LOG" ]; then
local log="$LOG_D/${0##*/}.log"
- { : > "$log"; } >/dev/null 2>&1 && LOG="$log" ||
+ { [ -d "$LOG_D" ] || mkdir -p "$LOG_D"; } &&
+ { : > "$log"; } >/dev/null 2>&1 && LOG="$log" ||
LOG="/dev/kmsg"
fi
echo "$@" >> "$LOG"