Skip to content

Instantly share code, notes, and snippets.

@gordlea
Last active January 6, 2016 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gordlea/515d449d7d8a60ea06aa to your computer and use it in GitHub Desktop.
Save gordlea/515d449d7d8a60ea06aa to your computer and use it in GitHub Desktop.
weave autolaunch on trusty
# scope - start weave after weave
# place under /etc/init/scope.conf
description "starts weave.scope"
author "Gord Lea <jgordonlea@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas
start on started weave
stop on stopping weave
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
# This option does not seem to be of great importance, so it does not need to be set.
expect fork
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
SCOPE=/usr/local/bin/scope
exec "$SCOPE" launch
end script
pre-stop script
scope stop
end script
# put under /etc/default/weave
#WEAVE_HOSTS="10.0.0.159 10.0.0.122"
# weave - start weave after docker launches
# place under /etc/init/weave.conf
description "starts weave.net"
author "Gord Lea <jgordonlea@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas
start on started docker
stop on stopping docker
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
# This option does not seem to be of great importance, so it does not need to be set.
expect fork
pre-start script
weave stop
end script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
WEAVE=/usr/local/bin/weave
WEAVE_HOSTS=
if [ -f /etc/default/$UPSTART_JOB ]; then
. /etc/default/$UPSTART_JOB
fi
exec "$WEAVE" launch $WEAVE_HOSTS
end script
pre-stop script
weave stop
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment