xl2tpd: fix aliveness check for xl2tpd process.
authorYousong Zhou <redacted>
Tue, 11 Aug 2015 03:46:29 +0000 (11:46 +0800)
committerYousong Zhou <redacted>
Fri, 14 Aug 2015 04:16:27 +0000 (12:16 +0800)
This change aims to address the following 2 issues

 - The control file was there yet xl2tpd process was not
 - The control file's existence prevented xl2tpd from start

Signed-off-by: Yousong Zhou <redacted>
net/xl2tpd/files/l2tp.sh

index 74c956c21e5ea69eeb3d786386805a9ab886e9d5..be6b61dccc038086e2627a508d9e00f1b0b6b4de 100644 (file)
@@ -39,8 +39,9 @@ proto_l2tp_setup() {
                exit 1
        }
 
-       if [ ! -p /var/run/xl2tpd/l2tp-control ]; then
-               /etc/init.d/xl2tpd start
+       # Start and wait for xl2tpd
+       if [ ! -p /var/run/xl2tpd/l2tp-control -o -z "$(pidof xl2tpd)" ]; then
+               /etc/init.d/xl2tpd restart
 
                local wait_timeout=0
                while [ ! -p /var/run/xl2tpd/l2tp-control ]; do
git clone https://git.99rst.org/PROJECT