xebd / accel-ppp

High performance PPTP/L2TP/PPPoE/IPoE server for Linux
GNU General Public License v2.0
296 stars 108 forks source link

"accel-cmd reload" can't work properly when accel-pppd works in deamon mode #74

Closed nktaozhenyu closed 5 years ago

nktaozhenyu commented 5 years ago

Hi, I'm trying to set up a L2TP Server on the Centos7.3 by using accel-pppd. I'm having issues with "accel-cmd reload" command. It can work well in normal mode without "-d" parameter specified,but alway failed when "-d" parameter specified.But other accel-cmd command(such as show stat) don't act like this.

  Details are as follows:
  1)OS: CentOS Linux release 7.3.1611 (Core) 
     GCC:8.2.0
     accel-pppd: lastest version(https://codeload.github.com/xebd/accel-ppp/zip/master)、
                             1.11.2(https://jaist.dl.sourceforge.net/project/accel-ppp/accel-ppp-1.11.2.tar.bz2) 
     compile parameter:cmake -DBUILD_DRIVER=FALSE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-g -O0 -ggdb3" -DLOG_PGSQL=FALSE -DSHAPER=TRUE -DRADIUS=TRUE -DNETSNMP=FALSE ..

  2) reload failed but show stat worked well. 

[root@centos-test bin]# ./accel-cmd reload failed [root@centos-test bin]# ./accel-cmd show sessions ifname | username | calling-sid | ip | type | comp | state | uptime --------+----------+-------------+----+------+------+-------+--------

  3)I can't find any userful information in Log files ,but I put them here.

[2019-05-27 15:07:01]: info: cli: tcp: new connection from 127.0.0.1 [2019-05-27 15:07:01]: debug: cli: disconnect [2019-05-27 15:07:07]: info: cli: tcp: new connection from 127.0.0.1 [2019-05-27 15:07:07]: debug: cli: disconnect

Would you please help me ?Waiting for your reply, thans.

DmitriyEshenko commented 5 years ago

Hi, can you show running process? ps ax | grep accel-pppd try add -p <pid> if run without pid, like accel-pppd -c /etc/accel-ppp.conf -d -p /var/run/accel-ppp.pid

nktaozhenyu commented 5 years ago

Hi, I'm very happy to receive your reply. Following your request,I tryed running the application again with latest version,but can't find the file accel-ppp.pid. Details are as follows:

[root@centos-test sbin]# ps ax | grep accel-pppd og 10106 pts/0 R+ 0:00 grep --color=auto accel-pppd [root@centos-test sbin]# ./accel-pppd -c ../etc/accel-ppp.conf.dist -d -p ../var/run/accel-ppp.pid [root@centos-test sbin]# ps ax | grep accel-pppd 10108 ? Ssl 0:00 ./accel-pppd -c ../etc/accel-ppp.conf.dist -d -p ../var/run/accel-ppp.pid 10110 pts/0 S+ 0:00 grep --color=auto accel-pppd [root@centos-test sbin]# ls -l ../var/run/ ls: 无法访问../var/run/: 没有那个文件或目录 [root@centos-test sbin]# ../bin/accel-cmd show sessions ifname | username | calling-sid | ip | type | comp | state | uptime --------+----------+-------------+----+------+------+-------+-------- [root@centos-test sbin]# ../bin/accel-cmd reload failed [root@centos-test sbin]# ps ax | grep accel-pppd 10108 ? Ssl 0:00 ./accel-pppd -c ../etc/accel-ppp.conf.dist -d -p ../var/run/accel-ppp.pid 10129 pts/0 S+ 0:00 grep --color=auto accel-pppd [root@centos-test sbin]# cat ../var/log/accel-ppp/accel-ppp.log [2019-05-28 14:05:32]: warn: l2tp: iprange module disabled, improper IP configuration of PPP interfaces may cause kernel soft lockup [2019-05-28 14:05:32]: info: cli: tcp: new connection from 127.0.0.1 [2019-05-28 14:05:32]: debug: cli: disconnect [2019-05-28 14:05:32]: info: cli: tcp: new connection from 127.0.0.1 [2019-05-28 14:05:32]: debug: cli: disconnect [root@centos-test sbin]# netstat -na |grep 2001 tcp 0 0 127.0.0.1:2001 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2001 127.0.0.1:35250 TIME_WAIT
tcp 0 0 127.0.0.1:2001 127.0.0.1:35254 TIME_WAIT

nktaozhenyu@aliyun.com

From: Eshenko Dmitriy Date: 2019-05-28 13:52 To: xebd/accel-ppp CC: nktaozhenyu; Author Subject: Re: [xebd/accel-ppp] "accel-cmd reload" can't work properly when accel-pppd works in deamon mode (#74) Hi, can you show running process? ps ax | grep accel-pppd try add -p like accel-pppd -c /etc/accel-ppp.conf -d -p /var/run/accel-ppp.pid — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

DmitriyEshenko commented 5 years ago

/var/run/ does not exist? try set absolute path and change directory for pid like ./accel-pppd -d -c /etc/accel-ppp.conf.dist -p /var/run/accel-ppp.pid and show me please accel-cmd -V

nktaozhenyu commented 5 years ago

Thank you for your reminder. I think I've found the cause of the issue. While "-d" parameter specified, statement("daemon(0, 0);") is executed. The current working directory is changed to the root ("/") , standard output and standard error are redirected to /dev/null. So when I specify the relative config path rather than absolute path, the application can't find the config file and can't ouput error message.

Thany you very much.

nktaozhenyu@aliyun.com

From: Eshenko Dmitriy Date: 2019-05-28 15:21 To: xebd/accel-ppp CC: nktaozhenyu; Author Subject: Re: [xebd/accel-ppp] "accel-cmd reload" can't work properly when accel-pppd works in deamon mode (#74) /var/run/ does not exist? try set absolute path and change directory for pid like ./accel-pppd -c /etc/accel-ppp.conf.dist -d -p /var/run/accel-ppp.pid — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.