summaryrefslogtreecommitdiff
path: root/net-misc/exabgp/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
commitf516638b7fe9592837389826a6152a7e1b251c54 (patch)
tree8bfecb640b7b6403d7a3d662d923eed630033da7 /net-misc/exabgp/files
parent1a61119f9f7b057830e2ce0563f913ec86f282ad (diff)
gentoo resync : 30.05.2020
Diffstat (limited to 'net-misc/exabgp/files')
-rw-r--r--net-misc/exabgp/files/exabgp-4.2.7-paths.patch13
-rw-r--r--net-misc/exabgp/files/exabgp.confd10
-rw-r--r--net-misc/exabgp/files/exabgp.initd59
-rw-r--r--net-misc/exabgp/files/exabgp.logrotate5
-rw-r--r--net-misc/exabgp/files/exabgp.tmpfiles3
5 files changed, 90 insertions, 0 deletions
diff --git a/net-misc/exabgp/files/exabgp-4.2.7-paths.patch b/net-misc/exabgp/files/exabgp-4.2.7-paths.patch
new file mode 100644
index 000000000000..0744a00d6939
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp-4.2.7-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 58d47087..a4266d05 100644
+--- a/setup.py
++++ b/setup.py
+@@ -31,7 +31,7 @@ def filesOf(directory):
+
+
+ data_files = [
+- ('etc/exabgp/examples', filesOf('etc/exabgp')),
++ ('share/exabgp/examples', filesOf('etc/exabgp')),
+ ]
+
+ if platform.system() != 'NetBSD':
diff --git a/net-misc/exabgp/files/exabgp.confd b/net-misc/exabgp/files/exabgp.confd
new file mode 100644
index 000000000000..2586be12393d
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp.confd
@@ -0,0 +1,10 @@
+# /etc/conf.d/exabgp
+
+# arguments to pass to exabgp
+#EXABGP_ARGS="/etc/exabgp/exabgp.conf"
+
+# user to run exabgp as
+#EXABGP_USER=exabgp
+
+# group to run exabgp as
+#EXABGP_GROUP=exabgp
diff --git a/net-misc/exabgp/files/exabgp.initd b/net-misc/exabgp/files/exabgp.initd
new file mode 100644
index 000000000000..e220108d8262
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp.initd
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# default arguments
+: "${EXABGP_ARGS:=--env=/etc/${RC_SVCNAME}/exabgp.env /etc/${RC_SVCNAME}/exabgp.conf}"
+
+command="capsh"
+command_args="
+ --uid=${EXABGP_USER:-exabgp}
+ --gid=${EXABGP_GROUP:-exabgp}
+ --caps='cap_net_admin+epi cap_setuid+ep-i cap_setgid+ep-i'
+ -- -c \"/usr/bin/exabgp ${EXABGP_ARGS}\""
+command_background="yes"
+pidfile="/run/exabgp/${RC_SVCNAME}.pid"
+start_stop_daemon_args="
+ --stdout /var/log/${RC_SVCNAME}/exabgp.log
+ --stderr /var/log/${RC_SVCNAME}/exabgp.log"
+extra_started_commands="routes sessions"
+extra_commands="checkconfig"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+ /run/exabgp || return
+
+ checkpath -q -p -m 0600 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+ /run/exabgp/${RC_SVCNAME}.{in,out} || return
+
+ checkconfig || return
+}
+
+stop_pre() {
+ # don't restart if the configuration is bad
+ if [ "${RC_CMD}" = restart ]; then
+ checkconfig || return
+ fi
+}
+
+checkconfig() {
+ ebegin "Checking configuration for ${RC_SVCNAME}"
+ exabgp -t ${EXABGP_ARGS}
+ eend ${?} "Invalid configuration"
+}
+
+sessions() {
+ ebegin "Querying sessions"
+ exabgpcli --env /etc/${RC_SVCNAME}/exabgp.env show neighbor summary
+ eend ${?} "exabgpcli failed"
+}
+
+routes() {
+ ebegin "Querying routes"
+ exabgpcli --env /etc/${RC_SVCNAME}/exabgp.env show adj-rib out
+ eend ${?} "exabgpcli failed"
+}
diff --git a/net-misc/exabgp/files/exabgp.logrotate b/net-misc/exabgp/files/exabgp.logrotate
new file mode 100644
index 000000000000..0616196211ac
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp.logrotate
@@ -0,0 +1,5 @@
+/var/log/exabgp/*.log {
+ missingok
+ compress
+ copytruncate
+}
diff --git a/net-misc/exabgp/files/exabgp.tmpfiles b/net-misc/exabgp/files/exabgp.tmpfiles
new file mode 100644
index 000000000000..80720cbfc1f7
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp.tmpfiles
@@ -0,0 +1,3 @@
+f /run/exabgp 0755 exabgp exabgp - -
+p /run/exabgp/exabgp.in 0600 exabgp exabgp - -
+p /run/exabgp/exabgp.out 0600 exabgp exabgp - -