Frage

with an unprivileged user account, using bash, I could do:

sudo /bin/sleep 6000

and kill it with Ctrl-c. However, sending SIGINT or SIGKILL from another terminal won't work for that purpose.

Anyone knows why is that? I'd like to be able to kill the process sending a signal, for using in a script, for example.

Regards.

War es hilfreich?

Lösung

You're only allowed to send signals to a process running with the same UID (unless the sending process is running as root). When you use sudo, the new process is running as root, but if you try to kill it you're running as your normal userid. You would have to use sudo kill PID to kill it.

Signals sent from terminal control characters are treated specially: they can be sent to any process running in the same login session as the terminal.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top