aboutsummaryrefslogtreecommitdiffstats
path: root/testing/consul/consul.initd
diff options
context:
space:
mode:
authorGennady Feldman <gena01@gmail.com>2016-09-15 00:30:47 +0000
committerJakub Jirutka <jakub@jirutka.cz>2016-09-16 13:07:17 +0200
commit43f2f98536d47f4fb17bebadbb547baccf156ab0 (patch)
tree53c24b9afdd383324341b0781feab7250251bdd3 /testing/consul/consul.initd
parent8bb108c256ed10c31ebf5bf8abfe1c75c06f4284 (diff)
downloadaports-43f2f98536d47f4fb17bebadbb547baccf156ab0.tar.bz2
aports-43f2f98536d47f4fb17bebadbb547baccf156ab0.tar.xz
testing/consul: update to 0.7.0
* Update consul to 0.7.0 * Update init.d script to run configtest and create a log file
Diffstat (limited to 'testing/consul/consul.initd')
-rw-r--r--testing/consul/consul.initd18
1 files changed, 16 insertions, 2 deletions
diff --git a/testing/consul/consul.initd b/testing/consul/consul.initd
index 73613d979c..24d727d93d 100644
--- a/testing/consul/consul.initd
+++ b/testing/consul/consul.initd
@@ -1,21 +1,35 @@
-#!/sbin/runscript
+#!/sbin/openrc-run
+CONSUL_LOG_FILE="/var/log/${SVCNAME}.log"
name=consul
+description="A tool for service discovery, monitoring and configuration"
+description_checkconfig="Verify configuration file"
daemon=/usr/sbin/$name
daemon_user=$name
daemon_group=$name
+extra_commands="checkconfig"
+
+start_pre() {
+ checkpath -f -m 0644 -o ${SVCNAME}:${SVCNAME} "$CONSUL_LOG_FILE"
+}
depend() {
need net
after firewall
}
+checkconfig() {
+ consul configtest -config-dir /etc/consul
+}
+
start() {
+ checkconfig || return 1
+
ebegin "Starting ${name}"
start-stop-daemon --start --quiet \
-m --pidfile /var/run/${name}.pid \
--user ${daemon_user} --group ${daemon_group} \
- -b -1 /dev/null -2 /dev/null \
+ -b --stdout $CONSUL_LOG_FILE --stderr $CONSUL_LOG_FILE \
-k 027 --exec ${daemon} -- ${consul_opts}
eend $?
}