Changeset 29079


Ignore:
Timestamp:
2011-11-13T23:16:25+01:00 (6 years ago)
Author:
nico
Message:

packages/bird: use new service functions

Location:
packages/net/bird
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • packages/net/bird/Makefile

    r28243 r29079  
    99PKG_NAME:=bird 
    1010PKG_VERSION:=1.3.3 
    11 PKG_RELEASE:=1 
     11PKG_RELEASE:=2 
    1212 
    1313PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz 
  • packages/net/bird/files/bird4.init

    r20780 r29079  
    11#!/bin/sh /etc/rc.common 
     2# Copyright (C) 2010-2011 OpenWrt.org 
    23 
    34START=50 
    45 
    5 # Birdloop is used to restart BIRD if it crashed. Unfortunately, it also 
    6 # hides and handles in the same manner start-time errors (like parse error 
    7 # in config file). Therefore, it is not used by default. If you want to 
    8 # use it, comment the first line and uncomment the second line in start(). 
     6SERVICE_DAEMONIZE=1 
     7SERVICE_WRITE_PID=1 
    98 
    109start() { 
    11         /usr/sbin/bird4 
    12 #       /usr/sbin/bird4loop 
     10        service_start /usr/sbin/bird4 -d 
     11#       ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird4loop ) 
    1312} 
    1413 
    1514stop() { 
    16         killall bird4 
    17         sleep 1 
     15#       ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird4loop ) 
     16        service_stop /usr/sbin/bird4 
    1817} 
    1918 
    2019reload() { 
    21         killall -HUP bird4 
     20        service_reload /usr/sbin/bird4 
    2221} 
  • packages/net/bird/files/bird4loop

    r20780 r29079  
    33BIRD=/usr/sbin/bird4 
    44 
    5 $BIRD -p 
     5$BIRD -p || return 1 
    66 
    7 ( until $BIRD -d "$@" 
    8 do 
    9         logger error BIRD4 died! 
    10         sleep 2 
    11 done; ) </dev/null >/dev/null 2> /dev/null & 
     7. /lib/functions.sh 
    128 
     9SERVICE_DAEMONIZE=1 
     10SERVICE_WRITE_PID=1 
     11 
     12sig_handler() { 
     13        running=0 
     14        service_stop $BIRD 
     15} 
     16 
     17running=1 
     18trap sig_handler INT 
     19trap sig_handler TERM 
     20while [ $running -gt 0 ]; do 
     21        service_check $BIRD || service_start $BIRD -d "$@" 
     22        sleep 3 
     23done 
  • packages/net/bird/files/bird6.init

    r20780 r29079  
    11#!/bin/sh /etc/rc.common 
     2# Copyright (C) 2010-2011 OpenWrt.org 
    23 
    34START=50 
    45 
    5 # Birdloop is used to restart BIRD if it crashed. Unfortunately, it also 
    6 # hides and handles in the same manner start-time errors (like parse error 
    7 # in config file). Therefore, it is not used by default. If you want to 
    8 # use it, comment the first line and uncomment the second line in start(). 
     6SERVICE_DAEMONIZE=1 
     7SERVICE_WRITE_PID=1 
    98 
    109start() { 
    11         /usr/sbin/bird6 
    12 #       /usr/sbin/bird6loop 
     10        service_start /usr/sbin/bird6 -d 
     11#       ( SERVICE_MATCH_NAME=1 service_start /usr/sbin/bird6loop ) 
    1312} 
    1413 
    1514stop() { 
    16         killall bird6 
    17         sleep 1 
     15#       ( SERVICE_MATCH_NAME=1 service_stop /usr/sbin/bird6loop ) 
     16        service_stop /usr/sbin/bird6 
    1817} 
    1918 
    2019reload() { 
    21         killall -HUP bird6 
     20        service_reload /usr/sbin/bird6 
    2221} 
  • packages/net/bird/files/bird6loop

    r20780 r29079  
    33BIRD=/usr/sbin/bird6 
    44 
    5 $BIRD -p 
     5$BIRD -p || return 1 
    66 
    7 ( until $BIRD -d "$@" 
    8 do 
    9         logger error BIRD6 died! 
    10         sleep 2 
    11 done; ) </dev/null >/dev/null 2> /dev/null & 
     7. /lib/functions.sh 
    128 
     9SERVICE_DAEMONIZE=1 
     10SERVICE_WRITE_PID=1 
     11 
     12sig_handler() { 
     13        running=0 
     14        service_stop $BIRD 
     15} 
     16 
     17running=1 
     18trap sig_handler INT 
     19trap sig_handler TERM 
     20while [ $running -gt 0 ]; do 
     21        service_check $BIRD || service_start $BIRD -d "$@" 
     22        sleep 3 
     23done 
Note: See TracChangeset for help on using the changeset viewer.