5

I am trying to debug a problem on a linux server.

When I run sudo ls / the command takes several seconds to run. non-sudo ls / runs as expected.

I suspect it has something to do with auditing going on via auditd but I'm not certain.

Anyway, I then tried to run the command with strace: strace sudo ls /, and the command runs just fine. In other words, it appears I'm in a heisenbug, where using strace to observe the behavior is in fact changing the behavior.

So while I am ultimately interested in figuring out why sudo ls / takes so long, right now I'm really curious to learn how to use strace to figure this out, and figure out if I'm using strace wrong and how to use it correctly.

marc esher
  • 4,871
  • 3
  • 36
  • 51
  • Try narrowing it down by doing `sudo true`. Also, note that you need to avoid any caching by the authentication modules. What PAM modules are you using, if any? – Jonathon Reinhart Feb 25 '17 at 01:20

0 Answers0