strace
http://www.thegeekstuff.com/2011/11/strace-examples
http://hokstad.com/5-simple-ways-to-troubleshoot-using-strace
To see what a running process is doing:
strace -p 1234 -s 80
To trace only network calls:
strace -f -n trace=network -s 80 -o /home/khai/out -c -p 1234
To see only a trace of the open, read system calls, enter:
strace -e trace=open,read -p 22254 -s 80
To capture the output of strace into a file: (use -o option)
strace -e trace=open,read -p 22254 -s 80 -o debug.webserver.txt
To launch an executable and trace it:
strace /bin/foo
page revision: 6, last edited: 25 May 2017 21:24