summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/bird/files')
-rw-r--r--net-misc/bird/files/confd-bird-29
-rwxr-xr-x[-rw-r--r--]net-misc/bird/files/initd-bird-216
2 files changed, 23 insertions, 2 deletions
diff --git a/net-misc/bird/files/confd-bird-2 b/net-misc/bird/files/confd-bird-2
new file mode 100644
index 00000000000..a2dc3ed89db
--- /dev/null
+++ b/net-misc/bird/files/confd-bird-2
@@ -0,0 +1,9 @@
+# /etc/init.d/bird
+
+# Options to pass to the bird process
+# See https://bird.network.cz/?get_doc&v=20&f=bird-1.html#ss1.3
+# BIRD_GROUP and BIRD_USER will be appended to BIRD_OPTS
+
+#BIRD_GROUP="bird"
+#BIRD_USER="bird"
+#BIRD_OPTS=""
diff --git a/net-misc/bird/files/initd-bird-2 b/net-misc/bird/files/initd-bird-2
index 06030d4b301..3b759df883d 100644..100755
--- a/net-misc/bird/files/initd-bird-2
+++ b/net-misc/bird/files/initd-bird-2
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Copyright 2019 Alarig Le Lay <alarig@grifon.fr>
# Distributed under the terms of the GNU General Public License v2
@@ -8,12 +8,20 @@ extra_started_commands="reload"
pidfile="/run/${RC_SVCNAME}.pid"
command="/usr/sbin/${RC_SVCNAME}"
retry=15
+start_stop_daemon_args="--make-pidfile"
CONF_FILE="/etc/${RC_SVCNAME}.conf"
SOCK="/run/${RC_SVCNAME}.ctl"
+if [ ${BIRD_GROUP} ]; then
+ BIRD_OPTS="${BIRD_OPTS} -g ${BIRD_GROUP}"
+fi
+if [ ${BIRD_USER} ]; then
+ BIRD_OPTS="${BIRD_OPTS} -u ${BIRD_USER}"
+fi
+
client_args="-s ${SOCK}"
-command_args="${client_args} -c ${CONF_FILE} -P ${pidfile}"
+command_args="${client_args} -c ${CONF_FILE} -P ${pidfile} ${BIRD_OPTS}"
client_args="${client_args} -r"
depend() {
@@ -44,6 +52,10 @@ reload() {
eend $?
}
+start_post() {
+ checkpath -f -m 0655 -o bird:bird "${pidfile}"
+}
+
stop_pre() {
if [ "${RC_CMD}" = "restart" ] ; then
check_run || return 1