packages/olsrd: use new service functions
authorNicolas Thill <nico@openwrt.org>
Sun, 13 Nov 2011 22:15:58 +0000 (22:15 +0000)
committerNicolas Thill <nico@openwrt.org>
Sun, 13 Nov 2011 22:15:58 +0000 (22:15 +0000)
SVN-Revision: 29065

net/olsrd/Makefile
net/olsrd/files/olsrd.init

index 94c5f6651d800d7ba23088179cb297c009e3bb46..4ab85f179e6848374af9ee33d681cf60a5226f70 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2009-2010 OpenWrt.org
+# Copyright (C) 2009-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=olsrd
 PKG_VERSION:=0.6.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6
index dd82bb5619eca09eebdeff76d9d3e21ee0fa682b..db043279d2a692c58e2c1eb3a8aa6bdcfea06979 100644 (file)
@@ -1,8 +1,13 @@
 #!/bin/sh /etc/rc.common
+# Copyright (C) 2008-2011 OpenWrt.org
 # Copyright (C) 2008  Alina Friedrichsen <x-alina@gmx.net>
 # Special thanks to bittorf wireless ))
+
 START=65
 
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
 OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes'
 OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2'
 OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2'
@@ -596,17 +601,16 @@ start() {
                sysctl -w net.ipv6.bindv6only=1
                sed -e 's/^\t\t[0-9.]*[ ][0-9.]*$//' < "$OLSRD_CONFIG_FILE" > /var/etc/olsrd.conf.ipv6
                sed -i '/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' /var/etc/olsrd.conf.ipv6
-               olsrd -f /var/etc/olsrd.conf.ipv6 -nofork < /dev/null > /dev/null &
-
+               service_start /usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv6 -nofork
                sed -e 's/^IpVersion[ ][ ]*6$/IpVersion 4/' -e 's/^\t\t[A-Fa-f0-9.:]*[:][A-Fa-f0-9.:]*[ ][0-9]*$//' < "$OLSRD_CONFIG_FILE" > /var/etc/olsrd.conf.ipv4
-               olsrd -f /var/etc/olsrd.conf.ipv4 -nofork < /dev/null > /dev/null &
+               service_start /usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv4 -nofork
                sleep 3
                sysctl -w net.ipv6.bindv6only="$bindv6only"
        else
-               olsrd -f "$OLSRD_CONFIG_FILE" -nofork < /dev/null > /dev/null &
+               service_start /usr/sbin/olsrd -f "$OLSRD_CONFIG_FILE" -nofork
        fi
 }
 
 stop() {
-       killall olsrd
+       service_stop /usr/sbin/olsrd
 }