bird2: fix service restart and reload (#546)
authorYuxiang Zhu <vfreex+github@gmail.com>
Sat, 8 Feb 2020 21:47:13 +0000 (05:47 +0800)
committerGitHub <noreply@github.com>
Sat, 8 Feb 2020 21:47:13 +0000 (22:47 +0100)
`/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

bird2/Makefile
bird2/files/bird.init

index cad2dddae09b575c6d51d7919930f7a01ddff9c4..fc3d1c27d2a02d01b0100de04074980730ee1486 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bird2
 PKG_VERSION:=2.0.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird
index 18db4af77984c68afc8e5be6f44d95dde672b731..5f7a442fa5cc3b4f3d82cafd2eb62363c221b3bf 100644 (file)
@@ -11,10 +11,14 @@ BIRD_PID_FILE="/var/run/bird.pid"
 start_service() {
     mkdir -p /var/run
     procd_open_instance
-    procd_set_param command $BIRD_BIN -c $BIRD_CONF -P $BIRD_PID_FILE
+    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
+}