I am taking logs of command executed by user in a output file by attaching PID of BASH in strace.
$ strace -q -f -e execve -p $$ -o <outputFile>
It is working fine and I am getting all command list in output file.
But I face another problem. I cannot run sudo command when strace is attached with BASH PID.
I am getting the below error:
sudo: effective uid is not 0, is sudo installed setuid root?
I checked setuid is set on sudo binary
---s--x--x. 1 root root 123832 Mar 22 11:35 /usr/bin/sudo
sudo is working fine when I stop strace.
Is this a bug or there is any technical reason? Please help me on this.