From: Zac Medico Date: Thu, 20 Oct 2016 16:19:33 +0000 (-0700) Subject: app-admin/consul-template: use SIGINT to stop service X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=711da94a10a8594dc8567f07f7765a1f8905d44a;p=gentoo.git app-admin/consul-template: use SIGINT to stop service Package-Manager: portage-2.3.2 --- 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]