0

I've been writing a script that spawns a child process as a different user via sudo then I realized that my script is not getting SIGINT as opposed to when I run it without sudo.

As suspected strace shows that sudo calls setsid after clone which means my (python) scripts are in a different process-group and don't receive the same signals as the sudo process.

What would be the reason sudo calls setsid? Is there security benefit? Why isn't there an equivalent of su --session-command option to disable this behavior (which is also discouraged according to man page)?

1
  • I don't know the details, but check if Defaults !use_pty in sudoers makes sudo behave more like you expected. If it does then check the description of use_pty in man 5 sudoers. Commented Jan 4 at 0:45

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.