Bug 458295

Summary: System Monitor does not send signals to processes owned by other users
Product: [Applications] plasma-systemmonitor Reporter: Lastique <andysem>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: ahiemstra, kde, kdedev, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.24.4   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Lastique 2022-08-25 11:02:16 UTC
SUMMARY

Sending signals to processes owned by a different user (e.g. root) doesn't work. KSysGuard did support this feature - it would ask for a root password to gain permissions.

STEPS TO REPRODUCE

1. In the process list, select a process running under a different user, e.g. root.
2. Right click and Send Signal -> SIGKILL.

OBSERVED RESULT

Nothing happens, the process keeps running.

EXPECTED RESULT

System Monitor should show the standard dialog for entering the root password, then the signal should be sent to the process.

SOFTWARE/OS VERSIONS

Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-46-lowlatency (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4700HQ CPU @ 2.40GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4600
Comment 1 Arjen Hiemstra 2022-09-29 13:13:00 UTC
This seems to work for me, when I request to send a signal to a root or other user's processes, I correctly get the dialog requesting my root password.

Note that this is implemented using polkit, can you verify that your setup in that regard is correct? Also make sure you have the file /usr/share/polkit-1/actions/org.kde.ksysguard.processlisthelper.policy as that is what defines which actions are allowed.
Comment 2 Lastique 2022-09-29 13:49:45 UTC
(In reply to Arjen Hiemstra from comment #1)
> This seems to work for me, when I request to send a signal to a root or
> other user's processes, I correctly get the dialog requesting my root
> password.

I have two systems. On one of the systems, I do get a password dialog and the signal is sent (at least, SIGKILL is - the process dies).

On the other system, when I select SIGKILL in the context menu, I get a System Monitor confirmation dialog "Are you sure you want to end this process?". When I press End, nothing happens - no password dialog, signal not sent. This confirmation dialog is only shown for SIGKILL and SIGTERM, for other signals simply nothing happens.

On the first system, I do not get this confirmation dialog. Not for SIGKILL/SIGTERM, not for other signals.

> Note that this is implemented using polkit, can you verify that your setup
> in that regard is correct?

I didn't do anything to polkit, not knowingly anyway. What exactly should I check?

> Also make sure you have the file
> /usr/share/polkit-1/actions/org.kde.ksysguard.processlisthelper.policy as
> that is what defines which actions are allowed.

Yes, I have that file. On both systems.
Comment 3 Arjen Hiemstra 2022-09-29 17:03:49 UTC
Can you run this in a terminal and paste the output:

pkcheck -a org.kde.ksysguard.processlisthelper.sendsignal -u -p $(pidof plasmashell) | echo $?
Comment 4 Lastique 2022-09-29 17:37:40 UTC
(In reply to Arjen Hiemstra from comment #3)
> Can you run this in a terminal and paste the output:
> 
> pkcheck -a org.kde.ksysguard.processlisthelper.sendsignal -u -p $(pidof
> plasmashell) | echo $?

The command opens a root password dialog. After entering the password, the dialog closes. The console output is "0".
Comment 5 David Edmundson 2023-01-18 11:01:21 UTC
I can confirm it works for me. Given it also works on one of your two machines it points towards a setup issue of stray files or broken polkit.

Please confirm if this is still an issue on a newer release.
Comment 6 Lastique 2023-01-18 11:23:20 UTC
(In reply to David Edmundson from comment #5)
> I can confirm it works for me. Given it also works on one of your two
> machines it points towards a setup issue of stray files or broken polkit.
> 
> Please confirm if this is still an issue on a newer release.

This is still not resolved for me, the problem reproduces. I cannot test the newer KDE until the next Kubuntu LTS release.

If you think this is a setup issue then please let me know how to diagnose it. The previous tests show that polkit is working.
Comment 7 TraceyC 2025-05-09 22:30:45 UTC
I'm still not able to reproduce this on git-master, or on Kubuntu 25.04.
If you still are experiencing this bug with Kubuntu 24.04, I recommend reporting it via the Kubuntu issue tracker
https://wiki.ubuntu.com/Kubuntu/Bugs/Reporting

Thanks for your understanding.