diff --git a/elements/debian-upstart/README.md b/elements/debian-upstart/README.md new file mode 100644 index 00000000..807bc2ee --- /dev/null +++ b/elements/debian-upstart/README.md @@ -0,0 +1,3 @@ +By default Debian will use sysvinit for booting. If you want to experiment +with Upstart, or have need of it due to a need for upstart jobs, this +element will build the image with upstart as the init system. diff --git a/elements/debian-upstart/element-deps b/elements/debian-upstart/element-deps new file mode 100644 index 00000000..2dee1753 --- /dev/null +++ b/elements/debian-upstart/element-deps @@ -0,0 +1 @@ +debian diff --git a/elements/debian-upstart/root.d/05-debian-upstart b/elements/debian-upstart/root.d/05-debian-upstart new file mode 100755 index 00000000..5e012bfc --- /dev/null +++ b/elements/debian-upstart/root.d/05-debian-upstart @@ -0,0 +1,4 @@ +#!/bin/bash +set -eux +echo upstart >> ${TARGET_ROOT}/.extra-packages +echo debian-upstart >> ${TARGET_ROOT}/.distro-name diff --git a/elements/debian-upstart/root.d/20-debian-fix-upstart-jobs b/elements/debian-upstart/root.d/20-debian-fix-upstart-jobs new file mode 100755 index 00000000..1ea1eb4b --- /dev/null +++ b/elements/debian-upstart/root.d/20-debian-fix-upstart-jobs @@ -0,0 +1,11 @@ +#!/bin/bash +set -eux +# Working around bug in Debian cloud-init packages with upstart +# where startpar will wait forever for these because they are tasks +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735204 +for sysv_script in cloud-init cloud-init-local cloud-config cloud-final ; do + sudo rm -f ${TARGET_ROOT}/etc/rc2.d/??${sysv_script} ${TARGET_ROOT}/etc/init.d/${sysv_script} +done +# And working around upstart job bug in Debian where cloud-config will never run +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735207 +sudo sed -i -e 's/start on .*/start on started rc RUNLEVEL=[2345]/' ${TARGET_ROOT}/etc/init/cloud-config.conf diff --git a/elements/debian-upstart/root.d/99-cleanup-debian-upstart b/elements/debian-upstart/root.d/99-cleanup-debian-upstart new file mode 100755 index 00000000..cd029626 --- /dev/null +++ b/elements/debian-upstart/root.d/99-cleanup-debian-upstart @@ -0,0 +1,3 @@ +#!/bin/bash +set -eux +sudo rm -f ${TARGET_ROOT}/.distro-name ${TARGET_ROOT}/.extra-packages