From 4d518af3b7517f2c58bdf1ed578700eafccb7b27 Mon Sep 17 00:00:00 2001 From: trimstray Date: Mon, 17 Dec 2018 12:58:51 +0100 Subject: [PATCH] added new 'strace' one-liners - signed-off-by: trimstray --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index d97da74..e0a4bf3 100644 --- a/README.md +++ b/README.md @@ -890,6 +890,24 @@ ___ ##### Tool: [strace](https://en.wikipedia.org/wiki/Strace) +###### Track child process + +```bash +strace -f -p $(pidof glusterfsd) +``` + +###### Track process after 30 seconds + +```bash +timeout 30 strace $(< /var/run/zabbix/zabbix_agentd.pid) +``` + +###### Track child process and redirect output to a file + +```bash +ps auxw | grep 'sbin/[a]pache' | awk '{print " -p " $2}' | xargs strace -o /tmp/strace-apache-proc.out +``` + ###### Track the open request of a network port ```bash