Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quit strace when attached to a process?

Tags:

strace

[root@woyo test]# strace -o /tmp/lsof.strace -p 5625
Process 5625 attached - interrupt to quit
q

Anyone knows?

like image 965
compiler Avatar asked Mar 25 '11 10:03

compiler


2 Answers

This seems to occur when a process is blocked waiting for a pid that no longer exists.

If your strace doesn't respond to Ctrl + C, than as mentioned, use Ctrl + Z and bg to push it to the background then attach to the running strace process with another strace. This should tell you why the first strace is blocked.

# strace -p 32035
Process 32035 attached - interrupt to quit
^Z
# bg
[1]+ strace -p 32035 &
# ps uax|grep strace
root      1886  0.0  0.0 103452   840 pts/2    S+   05:59   0:00 grep strace
root     30114  0.0  0.0   4452   572 pts/2    S    05:59   0:00 strace -p 32035
# strace -p 30114
Process 30114 attached - interrupt to quit
wait4(-1, 

You can then kill off these processes with a kill -9

like image 74
Carl Bellingan Avatar answered Sep 18 '22 20:09

Carl Bellingan


Have you tried Ctrl + C ? That you give an "Interruption" signal to the command.

like image 20
Neva Avatar answered Sep 18 '22 20:09

Neva