mirror of
https://github.com/trimstray/the-book-of-secret-knowledge.git
synced 2024-12-24 04:15:29 +00:00
updated and fixed strace one-liners
- signed-off-by: trimstray <trimstray@gmail.com>
This commit is contained in:
parent
a073f86849
commit
74d49eb293
12
README.md
12
README.md
@ -1438,24 +1438,30 @@ ___
|
|||||||
|
|
||||||
##### Tool: [strace](https://en.wikipedia.org/wiki/Strace)
|
##### Tool: [strace](https://en.wikipedia.org/wiki/Strace)
|
||||||
|
|
||||||
###### Track child process
|
###### Track with child processes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
strace -f -p $(pidof glusterfsd)
|
strace -f -p $(pidof glusterfsd)
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Track process after 30 seconds
|
###### Track process with 30 seconds limit
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
timeout 30 strace $(< /var/run/zabbix/zabbix_agentd.pid)
|
timeout 30 strace $(< /var/run/zabbix/zabbix_agentd.pid)
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Track child process and redirect output to a file
|
###### Track processes and redirect output to a file
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ps auxw | grep '[a]pache' | awk '{print " -p " $2}' | xargs strace -o /tmp/strace-apache-proc.out
|
ps auxw | grep '[a]pache' | awk '{print " -p " $2}' | xargs strace -o /tmp/strace-apache-proc.out
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Track with print time spent in each syscall and limit length of print strings
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ps auxw | grep '[i]init_policy' | awk '{print " -p " $2}' | xargs strace -f -e trace=network -T -s 10000
|
||||||
|
```
|
||||||
|
|
||||||
###### Track the open request of a network port
|
###### Track the open request of a network port
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Loading…
Reference in New Issue
Block a user