summaryrefslogtreecommitdiff
path: root/upstart/cloud-run-user-script.conf
blob: 9a47e57b12badd5a438fab9d2507c1cba84a99e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# cloud-run-user-script - runs user scripts found in user-data, that are
#   stored in /var/lib/cloud/scripts by the initial cloudinit upstart job
description "execute cloud user scripts"

start on (stopped rc RUNLEVEL=[2345] and stopped cloud-config)
console output
task

script
iid=$(cloud-init-query instance-id) || exit 1
sdir="/var/lib/cloud/data/scripts/${iid}"
if [ -d "$sdir" ]; then
   exec cloud-init-run-module once-per-instance user-scripts execute \
      run-parts --regex '.*' "$sdir"
fi
end script