packages/bird: use new service functions
[lede-routing/.git] / net / bird / files / bird6.init
index 69b39ff148a3dedb88ef0e811c50f191e73c08b7..2efb4f0963c181106e50bd69c33ad984624d58c9 100644 (file)
@@ -1,22 +1,21 @@
 #!/bin/sh /etc/rc.common
+# Copyright (C) 2010-2011 OpenWrt.org
 
 START=50
 
-# Birdloop is used to restart BIRD if it crashed. Unfortunately, it also
-# hides and handles in the same manner start-time errors (like parse error
-# in config file). Therefore, it is not used by default. If you want to
-# use it, comment the first line and uncomment the second line in start().
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
 
 start() {
-       /usr/sbin/bird6
-#      /usr/sbin/bird6loop
+       service_start /usr/sbin/bird6 -d
+#      ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird6loop )
 }
 
 stop() {
-       killall bird6
-       sleep 1
+#      ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird6loop )
+       service_stop /usr/sbin/bird6
 }
 
 reload() {
-       killall -HUP bird6
+       service_reload /usr/sbin/bird6
 }