diff options
-rw-r--r-- | ec2init-disable.conf | 24 | ||||
-rw-r--r-- | ec2init.conf | 9 | ||||
-rw-r--r-- | ec2init.conf.goal | 14 |
3 files changed, 40 insertions, 7 deletions
diff --git a/ec2init-disable.conf b/ec2init-disable.conf new file mode 100644 index 00000000..b9d57f06 --- /dev/null +++ b/ec2init-disable.conf @@ -0,0 +1,24 @@ +start on startup +normal exit 0 1 + +console output + +script + set +e + i=0 + while ! touch /etc/TEST >/dev/null 2>&1; do + echo "DISABLER: waiting for writable /" + sleep 1 + i=$(($i+1)) + [ $i -lt 30 ] || { echo "DISABLER: bailing"; exit 0; } + done + f="/etc/init/ec2init.conf" + [ -e "$f" ] || { echo "DISABLER: no ${f}, exiting"; exit 0; } + echo "DISABLER: sleeping 5, then disabling ${f}" + sleep 5 + mv "${f}" "${f}.disabled" && + echo "DISABLER: disabled ${f}" || + echo "DISABLER: failed mv ${f} ${f}.disabled" + exit 0 +end script + diff --git a/ec2init.conf b/ec2init.conf index 046414dd..2168726e 100644 --- a/ec2init.conf +++ b/ec2init.conf @@ -1,12 +1,7 @@ -start on (mount MOUNTPOINT=/tmp and net-device-up IFACE=eth0) - -## In the future, we'll want the following. For now, the above -## is about as soon as I could get a writable / and have network up -## below needs a to 'mountall' and ifupdown -#start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0) +start on (local-filesystems and net-device-up IFACE=eth0) task console output -exec /usr/bin/ec2-init +exec /usr/bin/ec2-init start diff --git a/ec2init.conf.goal b/ec2init.conf.goal new file mode 100644 index 00000000..8ee2abef --- /dev/null +++ b/ec2init.conf.goal @@ -0,0 +1,14 @@ +## Hopefully, this is all we need sometime in the future for +## the ec2init.conf. It will get called as soon as +## eth0 comes up and / is mounted rw +## +## it requires +## newer mountall than 1.1 (for 'mounted' events) +## +start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0) + +task + +console output + +exec /usr/bin/ec2-init start |