Is there a way to prevent Gnome System Monitor from providing kill option in the context menu for a given process ?

If you can't help but asking why I want this, I was assigned the (perplexing) task of trying to prevent the execution of kill [specific process] for root/users with elevated privileges throughout the system. Apart from this sounding illogical, I have been reading posts that describe that this is not only not possible but detrimental.

So I decided to approach this by collecting evidences to corroborate the inviability of this, by breaking it into:

  1. prevent execution of kill from command line
  2. prevent killing of process from GUI
  3. prevent stopping systemd
  4. in my app (a .NET app which runs as a systemd daemon), intercept the kernel signal sent to the process upon running kill (perhaps calling sigaction) so to ignore the kill request.

This question tries to clear item number 2: does System Monitor offer the possibility of hiding/customizing commands from its context menu, such as kill, out-of-the-box ?

enter image description here

  • 1
    This uses the org.gnome.gnome-system-monitor.kill Polkit action - what you should do is disallow that action for your target users using Polkit.
    – muru
    Dec 20, 2021 at 11:47
  • I don't think you can use polkit to block root.
    – user10489
    Dec 20, 2021 at 13:07
  • @user10489: I am guessing he meant disabling the policy will prevent it from being shown to non-root users.
    – Veverke
    Dec 20, 2021 at 13:08


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.