1
0
mirror of https://git.openwrt.org/feed/routing.git synced 2024-06-17 04:33:58 +02:00
openwrt-routing/bird2/files/bird.init
Yuxiang Zhu c9ae9c8c50
bird2: fix service restart and reload (#546)
`/etc/init.d/bird restart` or `/etc/init.d/bird reload` has no effects.

This PR fixes this issue by:

- running the service in the foreground to meet the requirements of procd
- sending SIGHUP signal to reload the service
2020-02-08 22:47:13 +01:00

25 lines
511 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2017 OpenWrt.org
USE_PROCD=1
START=70
BIRD_BIN="/usr/sbin/bird"
BIRD_CONF="/etc/bird.conf"
BIRD_PID_FILE="/var/run/bird.pid"
start_service() {
mkdir -p /var/run
procd_open_instance
procd_set_param command $BIRD_BIN -f -c $BIRD_CONF -P $BIRD_PID_FILE
procd_set_param file "$BIRD_CONF"
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
reload_service() {
procd_send_signal bird
}