Debugging aids, Steps for versions v4.0-9 and earlier – Thinklogical Router - Configuring the ASCII Interface User Manual
Page 4
Debugging Aids
The API program has several options that may aid in setup and debugging. These include
logging the incoming ASCII commands, logging the communications to the internal control
process (aka AVR) and appending a comment to the response message that is returned after
each command. This comment contains more details about an error.
All these messages are written to the system log file: /var/log/ap
i located on the router internal
SD card.
These are the command line options to enable the API debug aids:
•
--debug
log a lot of detailed data
•
--api
log the API commands received
•
--avr
log the commands to the internal control process
•
--clog
log connection make/break status
•
--verbose
append a comment to each command response
The '--api' and '--avr' settings may be toggled by sending a system signal to the running API
program. As shown in the help text above, SIGUSR1 will toggle the API setting, and SIGUSR2
will toggle the avr setting. (see the example below for the syntax of the kill command)
Steps for versions V4.0-9 and earlier.
To send a signal to a program, you must know the Process ID (PID) of the program. PIDs may
be listed with the command: '
ps -eF
'. A sample is shown below. The second column lists the
PIDs and the last column lists the program command line. You need to find the vxrapi line that
does NOT have the '--serial' option listed. In the example below, there are two such lines each
marked with a '◄
'
.
# ps -eF
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
root
2427
1 0 109 236 0 13:39 ? 00:00:00 /usr/local/sbin/vxrapi –verbose ◄
root 2428 1 0 109 244 0 13:39 ? 00:00:00 /usr/local/sbin/vxrapi --serial
root
2434
2427
0 109 156 0 14:34 ? 00:00:00 /usr/local/sbin/vxrapi –verbose ◄
root 2437 772 0 206 344 0 14:34 pts/0 00:00:00 ps -eF
PID
2427
is the parent process for the network interface (it's PPID is 1). This is the PID that
should receive the signal to toggle the debug mode.
kill -USR1 2427
kill -USR2 2427
Versions 4.0-10 and later can use a simpler method to send
these signals.
killall -USR1 vxrapi
killall -USR2 vxrapi
# ps -eF
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
root 462 1 0 108 244 0 14:35 ? 00:00:00 /usr/local/sbin/vxrapi --verbose
root 463 453 0 206 344 0 14:35 pts/0 00:00:00 ps -eF
Note that there is only one copy of vxrapi running.
Revision: G