summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-10-20 09:19:33 -0700
committerZac Medico <zmedico@gentoo.org>2016-10-20 09:20:34 -0700
commit711da94a10a8594dc8567f07f7765a1f8905d44a (patch)
tree710787989eba91659fac8440d0e3fe791b130adb /app-admin/consul-template
parentapp-misc/cmatrix: Drop faulty ebuild. (diff)
downloadgentoo-711da94a10a8594dc8567f07f7765a1f8905d44a.tar.gz
gentoo-711da94a10a8594dc8567f07f7765a1f8905d44a.tar.bz2
gentoo-711da94a10a8594dc8567f07f7765a1f8905d44a.zip
app-admin/consul-template: use SIGINT to stop service
Package-Manager: portage-2.3.2
Diffstat (limited to 'app-admin/consul-template')
-rw-r--r--app-admin/consul-template/files/consul-template.initd9
-rw-r--r--app-admin/consul-template/files/consul-template.service1
2 files changed, 9 insertions, 1 deletions
diff --git a/app-admin/consul-template/files/consul-template.initd b/app-admin/consul-template/files/consul-template.initd
index 7add14f3a573..ab63e7fd7597 100644
--- a/app-admin/consul-template/files/consul-template.initd
+++ b/app-admin/consul-template/files/consul-template.initd
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 2015 Gentoo Foundation
+# Copyright 2015-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -23,3 +23,10 @@ depend() {
start_pre() {
checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
}
+
+stop() {
+ # SIGINT is required for graceful shutdown of consul-template
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --signal SIGINT --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/app-admin/consul-template/files/consul-template.service b/app-admin/consul-template/files/consul-template.service
index be4ac71c7288..69b1c86ddb46 100644
--- a/app-admin/consul-template/files/consul-template.service
+++ b/app-admin/consul-template/files/consul-template.service
@@ -9,6 +9,7 @@ Environment=CONSUL_TEMPLATE_DAEMON_OPTS="-config=/etc/consul-template.d"
ExecStart=/usr/bin/consul-template $CONSUL_TEMPLATE_DAEMON_OPTS
Restart=on-failure
SuccessExitStatus=12
+KillSignal=SIGINT
ExecReload=/bin/kill -HUP $MAINPID
[Install]