-
Notifications
You must be signed in to change notification settings - Fork 0
/
etcd.conf
35 lines (27 loc) · 849 Bytes
/
etcd.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
description "etcd Service"
author "Matthew Mihok"
env ETCD_HOME=/opt/etcd-3.0.1
env ETCD_DATA_DIR=/var/lib/etcd
env LOG_HOME=/var/log/etcd
# Run as etcd
setuid vagrant
setgid vagrant
# Make sure network and fs is up, and start in runlevels 2-5
start on (net-device-up
and local-filesystems
and runlevel [2345])
# Stop in runlevels 0,1 and 6
stop on runlevel [016]
# automatically respawn, but if its respwaning too fast (5 times in 60 seconds, don't do that)
respawn
respawn limit 5 60
# make sure node is there, the code directory is there
pre-start script
test -d $ETCD_DATA_DIR || { stop; exit 0; }
test -x $ETCD_HOME/etcd || { stop; exit 0; }
end script
# cd to code path and run node, with the right switches
script
export ETCD_NAME=`cat /etc/hostname`
exec etcd >> $LOG_HOME/etcd.log 2>&1
end script