packages/bird: use new service functions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29079 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
92399c4d51
commit
3da206df0a
@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=bird
|
PKG_NAME:=bird
|
||||||
PKG_VERSION:=1.3.3
|
PKG_VERSION:=1.3.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird
|
PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (C) 2010-2011 OpenWrt.org
|
||||||
|
|
||||||
START=50
|
START=50
|
||||||
|
|
||||||
# Birdloop is used to restart BIRD if it crashed. Unfortunately, it also
|
SERVICE_DAEMONIZE=1
|
||||||
# hides and handles in the same manner start-time errors (like parse error
|
SERVICE_WRITE_PID=1
|
||||||
# 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().
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
/usr/sbin/bird4
|
service_start /usr/sbin/bird4 -d
|
||||||
# /usr/sbin/bird4loop
|
# ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird4loop )
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
killall bird4
|
# ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird4loop )
|
||||||
sleep 1
|
service_stop /usr/sbin/bird4
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
killall -HUP bird4
|
service_reload /usr/sbin/bird4
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,22 @@
|
|||||||
|
|
||||||
BIRD=/usr/sbin/bird4
|
BIRD=/usr/sbin/bird4
|
||||||
|
|
||||||
$BIRD -p
|
$BIRD -p || return 1
|
||||||
|
|
||||||
( until $BIRD -d "$@"
|
. /lib/functions.sh
|
||||||
do
|
|
||||||
logger error BIRD4 died!
|
|
||||||
sleep 2
|
|
||||||
done; ) </dev/null >/dev/null 2> /dev/null &
|
|
||||||
|
|
||||||
|
SERVICE_DAEMONIZE=1
|
||||||
|
SERVICE_WRITE_PID=1
|
||||||
|
|
||||||
|
sig_handler() {
|
||||||
|
running=0
|
||||||
|
service_stop $BIRD
|
||||||
|
}
|
||||||
|
|
||||||
|
running=1
|
||||||
|
trap sig_handler INT
|
||||||
|
trap sig_handler TERM
|
||||||
|
while [ $running -gt 0 ]; do
|
||||||
|
service_check $BIRD || service_start $BIRD -d "$@"
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (C) 2010-2011 OpenWrt.org
|
||||||
|
|
||||||
START=50
|
START=50
|
||||||
|
|
||||||
# Birdloop is used to restart BIRD if it crashed. Unfortunately, it also
|
SERVICE_DAEMONIZE=1
|
||||||
# hides and handles in the same manner start-time errors (like parse error
|
SERVICE_WRITE_PID=1
|
||||||
# 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().
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
/usr/sbin/bird6
|
service_start /usr/sbin/bird6 -d
|
||||||
# /usr/sbin/bird6loop
|
# ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird6loop )
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
killall bird6
|
# ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird6loop )
|
||||||
sleep 1
|
service_stop /usr/sbin/bird6
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
killall -HUP bird6
|
service_reload /usr/sbin/bird6
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,22 @@
|
|||||||
|
|
||||||
BIRD=/usr/sbin/bird6
|
BIRD=/usr/sbin/bird6
|
||||||
|
|
||||||
$BIRD -p
|
$BIRD -p || return 1
|
||||||
|
|
||||||
( until $BIRD -d "$@"
|
. /lib/functions.sh
|
||||||
do
|
|
||||||
logger error BIRD6 died!
|
|
||||||
sleep 2
|
|
||||||
done; ) </dev/null >/dev/null 2> /dev/null &
|
|
||||||
|
|
||||||
|
SERVICE_DAEMONIZE=1
|
||||||
|
SERVICE_WRITE_PID=1
|
||||||
|
|
||||||
|
sig_handler() {
|
||||||
|
running=0
|
||||||
|
service_stop $BIRD
|
||||||
|
}
|
||||||
|
|
||||||
|
running=1
|
||||||
|
trap sig_handler INT
|
||||||
|
trap sig_handler TERM
|
||||||
|
while [ $running -gt 0 ]; do
|
||||||
|
service_check $BIRD || service_start $BIRD -d "$@"
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user