7 changed files with 71 additions and 26 deletions
@ -0,0 +1 @@
|
||||
886614099 103959898 consul |
@ -0,0 +1 @@
|
||||
https://releases.hashicorp.com/consul/1.5.0/consul_1.5.0_linux_amd64.zip |
@ -0,0 +1,38 @@
|
||||
#!/sbin/openrc-run |
||||
# 2019 Nico Schottelius (nico-cdist at schottelius.org) |
||||
|
||||
description="consul agent" |
||||
|
||||
pidfile="${CONSUL_PIDFILE:-"/var/run/$RC_SVCNAME/pidfile"}" |
||||
command="${CONSUL_BINARY:-"/usr/local/bin/consul"}" |
||||
|
||||
|
||||
checkconfig() { |
||||
if [ ! -d /var/run/consul ] ; then |
||||
mkdir -p /var/run/consul || return 1 |
||||
chown consul:consul /var/run/$NAME || return 1 |
||||
chmod 2770 /var/run/$NAME || return 1 |
||||
fi |
||||
} |
||||
|
||||
start() { |
||||
need net |
||||
|
||||
start-stop-daemon --start --quiet --oknodo \ |
||||
--pidfile "$pidfile" --background \ |
||||
--exec $command -- agent -pid-file="$pidfile" -config-dir /etc/consul/conf.d |
||||
} |
||||
start_pre() { |
||||
checkconfig |
||||
} |
||||
|
||||
stop() { |
||||
if [ "${RC_CMD}" = "restart" ] ; then |
||||
checkconfig || return 1 |
||||
fi |
||||
|
||||
ebegin "Stopping $RC_SVCNAME" |
||||
start-stop-daemon --stop --exec "$command" \ |
||||
--pidfile "$pidfile" --quiet |
||||
eend $? |
||||
} |
Loading…
Reference in new issue