diff options
author | Zac Medico <zmedico@gentoo.org> | 2017-01-22 20:59:26 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2017-01-22 21:17:34 -0800 |
commit | f54855d32da5c9c3302ea22e75d1666d65d15a80 (patch) | |
tree | f5a7709ac60143610d034a9e1ab98b0e5f7b638d /app-admin/serf/files | |
parent | profiles: Add app-emulation/libvirt zfs stable use mask (diff) | |
download | gentoo-f54855d32da5c9c3302ea22e75d1666d65d15a80.tar.gz gentoo-f54855d32da5c9c3302ea22e75d1666d65d15a80.tar.bz2 gentoo-f54855d32da5c9c3302ea22e75d1666d65d15a80.zip |
app-admin/serf: add package
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'app-admin/serf/files')
-rw-r--r-- | app-admin/serf/files/serf.confd | 7 | ||||
-rw-r--r-- | app-admin/serf/files/serf.initd | 39 | ||||
-rw-r--r-- | app-admin/serf/files/serf.logrotated | 8 | ||||
-rw-r--r-- | app-admin/serf/files/serf.service | 14 |
4 files changed, 68 insertions, 0 deletions
diff --git a/app-admin/serf/files/serf.confd b/app-admin/serf/files/serf.confd new file mode 100644 index 000000000000..f5aeaeddf7e7 --- /dev/null +++ b/app-admin/serf/files/serf.confd @@ -0,0 +1,7 @@ +# you can change the init script behavior by setting those parameters +# - group (default: serf) +# - pidfile (default: /run/serf/serf.pid) +# - user (default: serf) + +# extra arguments for the serf agent +command_args="-config-dir=/etc/serf.d" diff --git a/app-admin/serf/files/serf.initd b/app-admin/serf/files/serf.initd new file mode 100644 index 000000000000..ce69aea1d627 --- /dev/null +++ b/app-admin/serf/files/serf.initd @@ -0,0 +1,39 @@ +#!/sbin/openrc-run +# Copyright 2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="serf agent" +extra_started_commands="reload" +group=${group:-${RC_SVCNAME}} +pidfile=${pidfile:-"/run/${RC_SVCNAME}/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} + +command="/usr/bin/${RC_SVCNAME}" +command_args="agent -config-dir=/etc/serf.d ${command_args}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \ + --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log" + +depend() { + need net + after net +} + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + ${command} reload + eend $? +} + +start_pre() { + checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}" +} + +stop() { + # SIGINT is required for graceful shutdown of serf agent + ebegin "Stopping ${RC_SVCNAME}" + start-stop-daemon --stop --signal SIGINT --pidfile "${pidfile}" + eend $? +} diff --git a/app-admin/serf/files/serf.logrotated b/app-admin/serf/files/serf.logrotated new file mode 100644 index 000000000000..b4c778ab29a7 --- /dev/null +++ b/app-admin/serf/files/serf.logrotated @@ -0,0 +1,8 @@ +/var/log/serf/serf.log { + su serf serf + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-admin/serf/files/serf.service b/app-admin/serf/files/serf.service new file mode 100644 index 000000000000..f2d390fe8222 --- /dev/null +++ b/app-admin/serf/files/serf.service @@ -0,0 +1,14 @@ +[Unit] +Description=serf agent +Requires=network-online.target +After=network-online.target + +[Service] +User=serf +Environment=SERF_AGENT_OPTS="-config-dir=/etc/serf.d" +ExecStart=/usr/bin/serf agent $SERF_AGENT_OPTS +Restart=on-failure +KillSignal=SIGINT + +[Install] +WantedBy=multi-user.target |