strace

strace command is used to trace system calls. This is useful to see what a process is doing.

To see what a process doing, run

strace -p PID_HERE

To run a command and strace

strace cat 1.txt

Debug apache start up

strace -Ff -o output.txt -e open /etc/init.d/httpd restart
cat output.txt | grep '= -1'

log strace out put to a file when running a command

strace -f -o debug.log npm install

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *