diff options
Diffstat (limited to 'app-admin/consul-template/files')
4 files changed, 48 insertions, 0 deletions
diff --git a/app-admin/consul-template/files/consul-template.confd b/app-admin/consul-template/files/consul-template.confd new file mode 100644 index 000000000000..9af7d023305e --- /dev/null +++ b/app-admin/consul-template/files/consul-template.confd @@ -0,0 +1,7 @@ +# you can change the init script behavior by setting those parameters +# - group (default: consul-template) +# - pidfile (default: /run/consul-template/consul-template.pid) +# - user (default: consul-template) + +# extra arguments for the consul agent +command_args="-config=/etc/consul-template.d" diff --git a/app-admin/consul-template/files/consul-template.initd b/app-admin/consul-template/files/consul-template.initd new file mode 100644 index 000000000000..7add14f3a573 --- /dev/null +++ b/app-admin/consul-template/files/consul-template.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="consul-template agent" +group=${group:-${SVCNAME}} +pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"} +user=${user:-${SVCNAME}} + +command="/usr/bin/${SVCNAME}" +command_args="agent -config-dir=/etc/consul-template.d ${command_args}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/${SVCNAME}/${SVCNAME}.log \ + --stderr /var/log/${SVCNAME}/${SVCNAME}.log" + +depend() { + need net + after net +} + +start_pre() { + checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}" +} diff --git a/app-admin/consul-template/files/consul-template.service b/app-admin/consul-template/files/consul-template.service new file mode 100644 index 000000000000..be4ac71c7288 --- /dev/null +++ b/app-admin/consul-template/files/consul-template.service @@ -0,0 +1,15 @@ +[Unit] +Description=consul-template daemon +Requires=network-online.target +After=network-online.target + +[Service] +User=consul-template +Environment=CONSUL_TEMPLATE_DAEMON_OPTS="-config=/etc/consul-template.d" +ExecStart=/usr/bin/consul-template $CONSUL_TEMPLATE_DAEMON_OPTS +Restart=on-failure +SuccessExitStatus=12 +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=default.target diff --git a/app-admin/consul-template/files/localhost.json.example b/app-admin/consul-template/files/localhost.json.example new file mode 100644 index 000000000000..64dec09cfc90 --- /dev/null +++ b/app-admin/consul-template/files/localhost.json.example @@ -0,0 +1 @@ +consul = "127.0.0.1:8500" |