On 12/26/23, Greg Wooledge <g...@wooledge.org> wrote: > If you want to launch a SIMPLE BACKGROUND PROCESS (note the SIMPLE here, > this is IMPORTANT), and then strace it while it runs, you'd do it like > this: > > ping www.google.fr -c 4 & > pid=$! > strace -p "$pid" > wait "$pid"
I am getting an "Operation not permitted" error while strace tries to attach to that pid: "strace: attach: ptrace(PTRACE_SEIZE, 52527): Operation not permitted" $ ping www.google.fr -c 4 & pid=$! strace -p "$pid" wait "$pid" [1] 52527 strace: attach: ptrace(PTRACE_SEIZE, 52527): Operation not permitted PING www.google.fr (64.233.185.94) 56(84) bytes of data. 64 bytes from yb-in-f94.1e100.net (64.233.185.94): icmp_seq=1 ttl=55 time=54.2 ms 64 bytes from yb-in-f94.1e100.net (64.233.185.94): icmp_seq=2 ttl=55 time=61.3 ms 64 bytes from yb-in-f94.1e100.net (64.233.185.94): icmp_seq=3 ttl=55 time=60.5 ms 64 bytes from yb-in-f94.1e100.net (64.233.185.94): icmp_seq=4 ttl=55 time=125 ms --- www.google.fr ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 54.240/75.219/124.823/28.769 ms [1]+ Done ping www.google.fr -c 4 $