xl2tpd: refactor for more resilience.

- Use netifd no_proto_task for notifying that xl2tpd does not have a
   protocol task running.
 - Use procd for xl2tpd service management.
 - Refreshed 2xx patches to

    - Prevent leftover regular type control result file.
    - Allow xl2tpd run as foreground process while logging via syslog.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

 - bumped version
 - removed dependency on `ip` package as routes are setup by netifd
   if iproute2 is actually required, please depend on
   `@(PACKAGE_ip||PACKAGE_ip-full)` instead of `ip`

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Yousong Zhou
2015-04-29 21:11:16 +08:00
committed by Daniel Golle
parent 15f744bb53
commit 59f33d2aa7
17 changed files with 495 additions and 114 deletions
+15 -10
View File
@@ -1,18 +1,23 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2010 OpenWrt.org
# Copyright (C) 2006-2015 OpenWrt.org
START=60
USE_PROCD=1
BIN=xl2tpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
RUN_D="/var/run/xl2tpd"
PID_F="/var/run/xl2tpd.pid"
start() {
mkdir -p $RUN_D/$BIN
[ -f $DEFAULT ] && . $DEFAULT
$BIN $OPTIONS
start_service() {
rm -rf "$RUN_D"
mkdir -p "$RUN_D"
procd_open_instance
procd_set_param command $BIN -D -l -p "$PID_F"
procd_close_instance
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
stop_service() {
rm -rf "$RUN_D"
rm -rf "$PID_F"
}