2015-02-18 11:09:06 +00:00
|
|
|
description "Etcd service"
|
|
|
|
author "@jainvipin"
|
|
|
|
|
2015-07-19 23:11:12 +00:00
|
|
|
start on (net-device-up
|
|
|
|
and local-filesystems
|
|
|
|
and runlevel [2345])
|
|
|
|
|
2015-02-18 11:09:06 +00:00
|
|
|
respawn
|
|
|
|
|
|
|
|
pre-start script
|
|
|
|
# see also https://github.com/jainvipin/kubernetes-ubuntu-start
|
|
|
|
ETCD=/opt/bin/$UPSTART_JOB
|
|
|
|
if [ -f /etc/default/$UPSTART_JOB ]; then
|
|
|
|
. /etc/default/$UPSTART_JOB
|
|
|
|
fi
|
|
|
|
if [ -f $ETCD ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
echo "$ETCD binary not found, exiting"
|
|
|
|
exit 22
|
|
|
|
end script
|
|
|
|
|
|
|
|
script
|
|
|
|
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
|
|
|
|
ETCD=/opt/bin/$UPSTART_JOB
|
|
|
|
ETCD_OPTS=""
|
|
|
|
if [ -f /etc/default/$UPSTART_JOB ]; then
|
|
|
|
. /etc/default/$UPSTART_JOB
|
|
|
|
fi
|
|
|
|
exec "$ETCD" $ETCD_OPTS
|
|
|
|
end script
|