diff options
-rw-r--r-- | app-admin/consul-template/files/consul-template.initd | 9 | ||||
-rw-r--r-- | app-admin/consul-template/files/consul-template.service | 1 |
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] |