xl2tpd: fix by backporting the version from master branch

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou
2015-09-17 17:40:59 +08:00
parent 5fd21e2305
commit 77e4444a27
6 changed files with 110 additions and 71 deletions
+16 -10
View File
@@ -1,18 +1,24 @@
#!/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_set_param respawn
procd_close_instance
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
stop_service() {
rm -rf "$RUN_D"
rm -rf "$PID_F"
}