Trace delivered signals

Show only signals like SIGTERM and SIGCHLD and skip syscalls, to find out who killed the process; for library calls use ltrace

strace -f -e signal=all -e trace=none -p <pid>

tool
strace13 commands
tags
stracedebugtroubleshootingkernel

More strace commands

  • strace -o trace.log ls /tmp

    Run a command under strace and save the output to a file

  • strace -p $(pgrep nginx | head -1) -o /tmp/nginx.trace

    Trace the syscalls of a process that is already running, by PID

  • strace -e trace=openat,read,write curl https://example.com

    Show only openat, read and write calls and hide the rest

  • strace -c -e trace=all python3 app.py

    Print a summary table with the count and time of each syscall

  • strace -f -e trace=process nginx -t

    Trace process syscalls like fork and exec in all child processes (-f)

all 13 strace commands