Trying xkill to force close frozen apps, getting an error message: Permission Denied? Help!

I have recently been trying to use xkill approach to navigate my way round frozen apps on my Linux PC. But when I click the window, it would pop up an error message, “permission denied”. I always have to resort to

sudo killall <app_name>

I am not really comfortable with it like the xkill. I would like to know why xkill is not working for me to kill frozen apps. Which permission does the error message imply and how would I work around it?

1 Like

@Don11 - I tested this as xkill, and a red skull-and-crossbones cursor appears. I was able to click on a running app and all instances of the app were immediately killed.
From the xkill man page:
man xkill

If no resource identifier is given with ‐id, xkill
will display a special cursor as a prompt for the user to select a window to be killed

Another approach, via kill -9 <process_id>:

kill -9 $(ps -C <bad_application> -o pid=)

xkill by nature of it’s operation would require permission to because it has to send signals to the process that you want to force stop.

If it showed that the permission is denied, it simply means that the system is set to deny a user the ability to send signals to processes. It is a security measure.

It is either those restrictions are removed or you consider using “pkill <app_name>”.

Also read: How to Kill Inactive SSH Sessions

the instructions apply regardless of what you are trying to kill.

1 Like

It sounds like you have an infection of 'zombie' orphaned child processes. The zombie
killer is "kill -9 'PID'". Unless you clean up the child processes before the parent is
dead, it will happen again.

Happy Hacking
Steve Parker

@superuser1955 @hydn sorry for the late reply have been extremly busy with the other code projects. The best way to do is to use the kill and if that doesnt work on the ps | grep aux then use the
systemctl start application or systemctl stop application

alles super,
Gaurav

kill -9 is a dangerous process. Application may not work as expected because it will crash especially it doesn’t close naturally or may you need to reinstall application later. It is better to try to less application some time when frozen and try to close it naturally instead of kill -9.