commit: 711da94a10a8594dc8567f07f7765a1f8905d44a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 16:19:33 2016 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 16:20:34 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=711da94a
app-admin/consul-template: use SIGINT to stop service
Package-Manager: portage-2.3.2
app-admin/consul-template/files/consul-template.initd | 9 ++++++++-
app-admin/consul-template/files/consul-template.service | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/app-admin/consul-template/files/consul-template.initd
b/app-admin/consul-template/files/consul-template.initd
index 7add14f..ab63e7f 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 be4ac71..69b1c86 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]