From 632b351cfd0c9964a38fb0ba8ae651e88d4861dd Mon Sep 17 00:00:00 2001 From: DmitriyEshenko Date: Fri, 31 May 2024 19:24:37 +0000 Subject: deploy: edadda488d6146b60d2cc42219cf50c25701c797 --- debugging/faq.html | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++ debugging/index.html | 151 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 340 insertions(+) create mode 100644 debugging/faq.html create mode 100644 debugging/index.html (limited to 'debugging') diff --git a/debugging/faq.html b/debugging/faq.html new file mode 100644 index 0000000..a2e492e --- /dev/null +++ b/debugging/faq.html @@ -0,0 +1,189 @@ + + + + + + + FAQ — Accel-ppp 1.12 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

FAQ

+
+

HTB: quantum of class is big

+

When an error appears in the logs:

+
HTB: quantum of class 10001 is big. Consider r2q change.
+
+
+

You need to set a parameter for the shaper:

+
#accel-pp will calculate the value itself
+moderate-quantum=1
+
+
+
+
+

How to rotate logs ?

+

You can use system logrotate utility for it. Put following file to /etc/logrotate.d

+
/var/log/accel-ppp/*.log {
+      missingok
+      sharedscripts
+      postrotate
+              test -r /var/run/accel-pppd.pid && kill -HUP `cat /var/run/accel-pppd.pid`
+      endscript
+}
+
+
+
+
+

I don’t see pppd processes, how to manually terminate session ?

+

Yes, in fact accel-ppp doesn’t use pppd because it has its own ppp implementation. +To terminate session you may use three methods:

+
    +
  1. Use cli (telnet or tcp):

  2. +
+
By default telnet listens connections on 2000 port and tcp on 2001 port.
+$ telnet 127.0.0.1 2000
+Trying 127.0.0.1...
+Connected to 127.0.0.1.
+Escape character is '^]'.
+accel-ppp version 1.5.0
+accel-ppp# terminate if ppp0
+
+
+

or

+
$ echo 'terminate if ppp0' | nc -q0 127.0.0.1 2001
+
+
+

There are also other criterias to select session(s), use help cli command to get more information.

+
    +
  1. Use radius Disconnect-Message:

  2. +
+
$ echo 'NAS-Port=0' | radclient 127.0.0.1:3799 disconnect testing123
+Received response ID 170, code 41, length = 20
+
+
+

and you can control it in logs:

+
[2012-01-21|16:48:55]:  info: ppp0: recv [RADIUS|Disconnect-Request id=aa <NAS-Port 0>]
+[2012-01-21|16:48:55]:  info: ppp0: send [RADIUS|Disconnect-ACK id=aa]
+
+
+
    +
  1. Use snmp:

  2. +
+
$ snmpset -m +ACCEL-PPP-MIB -v 2c -c local 127.0.0.1 ACCEL-PPP-MIB::termByIfName.0 = ppp0
+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/debugging/index.html b/debugging/index.html new file mode 100644 index 0000000..f0d0f4b --- /dev/null +++ b/debugging/index.html @@ -0,0 +1,151 @@ + + + + + + + Debugging — Accel-ppp 1.12 documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Debugging

+

Sometimes for debugging need to build accel-ppp with additional flags:

+

-DCMAKE_BUILD_TYPE=Debug - Include debug information to accel-pppd binary

+

-DCMAKE_C_FLAGS='-g -O0' - Enable optimization flags

+

-DMEMDEBUG=TRUE - Set this flag if you want to debug memleak

+

Allow create core dump files without size limiting, edit /etc/security/limits.conf and add

+
*  soft  core  unlimited
+
+
+

Or run ulimit -c unlimited for apply immediately

+

Edit /etc/sysctl.conf to define core dump file name and location, add

+
kernel.core_uses_pid = 1
+kernel.core_pattern = /root/core-%e-%p
+
+
+

And apply sysctl -p

+

If accel-ppp runs as systemd service to allow create coredumps it is necessary to add DefaultLimitCORE=infinity to /etc/systemd/system.conf and run systemctl daemon-reexec to activate new params.

+

Recommended: to create a self-checking program with predefined mistake. Create test.c with the following content

+
int main() {
+  *(char *)0 = 0;
+  return 0;
+}
+
+
+

Compile this program gcc test.c and run ./a.out

+

If core files appear in /root directory and in dmesg exist output a.out[xxxx]: segfault at ... then all done properly.

+

Run accel-ppp in GDB (GNU Debugger)

+

If you want to run accel-ppp in GDB, necessary disable logratation for accel-ppp log files.

+
gdb -ex=run  --args accel-pppd -c /etc/accel-ppp.conf -p /var/run/accel-ppp.pid
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file -- cgit v1.2.3