description "Etcd service"
author "@jainvipin"

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
