Introduction
You may need to review detailed information on the system calls performed by the cPanel and WHM processes for troubleshooting difficult-to-track issues.
Procedure
- Access your server via SSH as the root user
- Run the following command to strace all of the active cPanel and WHM processes:
TSTAMP=$(date +%s); TDIR=/root/strace/strace-${TSTAMP}; mkdir -p ${TDIR} && echo "Working Directory: ${TDIR}" && strace -ff -T -t -v -yy -s 8192 -o ${TDIR}/pid $(ps auxwww | egrep 'cpsrv[d]|whostmgr[d]|cpanel[d]' | egrep -v 'defunct' | tee ${TDIR}/process-list.txt | awk '{ printf " -p " $2; }')
- Replicate the issue you are trying to troubleshoot in WHM or cPanel
- Press Ctrl+C in the command prompt to interrupt the strace after the issue has occurred
- The command creates a directory at /root/strace and a timestamped folder, with each running pid having its own strace file. You can use the "less" command to review the strace output:
less /root/strace/strace-{timestamp}/pid.916212
Additional Information
Basic guide for using strace to diagnose software problems on Linux
You can read more about strace and its output here:
Comments
0 comments
Article is closed for comments.