Installing and using Strace

Strace is a Linux command that allows you to follow what a process on your server is doing. Let's say process 351711 has been running for an extended period, and you're wondering if it's doing anything, or it's hung/stuck - strace is perfect for such situations! First of all, we need to install it.

yum install strace

Debian and Ubuntu:
apt-get install strace

Once it's installed, it's as simple as running strace -p PID (where PID is the process ID).

If there's no process running, you'll see something like this:

# strace -p 351711
strace: attach: ptrace(PTRACE_ATTACH, ...): No such process

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

cPanel: Running a ClamAV and Maldet scan

You may be familiar with ClamAV and Maldet (aka Linux Malware Detect). They're widely known as...

cPanel: What is mysqluserstore?

On cPanel servers, you may come across the process...

cPanel: Installing the LiteSpeed plugin

If your server is running cPanel/WHM, simply execute the below commands via SSH (as root):wget...

Changing the timezone

If you're like us, you'll want your server's timezone to match your local time to make log...

Finding the largest files and directories

This nifty command allows you to built up a list of the largest files and...