Skip to main content
30 votes
Accepted

Killing systemd service with and without systemctl

First, your systemctl syntax is wrong: systemctl kill expects a unit name, not a PID, and -s requires a signal name. As written, it won't do anything but give you an error message: Failed to parse ...
Michael Hampton's user avatar
3 votes
Accepted

Is it safe to stop a Jboss EAP server with Kill -9?

If the software is non-trivial and comes with a documented means of shutting it down, as appears to be the case here, go with whatever that is. (There may be multiple options.) Regarding SIGKILL (...
Håkan Lindqvist's user avatar
2 votes

Kill defunct xrdp session --- xrdp users cannot log on

xrdp is making a log diary about the session inside .xrdp* files stored into the user's home directory. It might happen some .xrdp* session files to be stored into /tmp/ or /tmp/.xrdp/. xrdp service ...
miki's user avatar
  • 21
2 votes

Kill a process and force it to return 0 in Linux?

To make sure the kill or killall command doesn't break the shell (like in a bash script with set -e), or make sure the line with kill exits with 0. We may try killall <PROCESS_NAME> || /bin/true ...
socrates's user avatar
  • 121
2 votes

VPS yum update filesystem ... killed

Create a Linux Swap File temporarily , 1GB is enough for "yum update -y" https://linuxize.com/post/create-a-linux-swap-file/
Netu Netov's user avatar
2 votes

kill a screen (but not all screens)

If you have several screens with the same name, you can kill them at once: screen -ls | egrep "^\s*[0-9]+.ScreenName" | awk -F "." '{print $1}' | xargs kill Command screen -ls prints screens with ...
محسن عباسی's user avatar
2 votes

Is it safe to stop a Jboss EAP server with Kill -9?

Just assume every gun is loaded and every application is signal 9 unsafe. Assuming otherwise you would very likely waste a huge amount of time in debugging occasional malfunctions, caused by things as ...
anx's user avatar
  • 11.2k
2 votes

How to kill a process by its full name, including the path?

If your script can be shown by its full name including the path using ps, you can easily do that: MYPID=$( ps faux | grep '/tmp/test.sh' | grep -vw grep | awk '{ print $2 }' ); echo ${MYPID}; kill -9 ...
Craft's user avatar
  • 171
1 vote
Accepted

How to restart linux services if it reaches 100% CPU?

You might want to take a look at monit (official site). It's easily configurable to watch for high CPU usage and restart processes when needed. A simple example (you should configure it according ...
Daniele Santi's user avatar
1 vote
Accepted

Permission denied when using kill as root

Check if you have Apparmor enabled, it can block your attempts to kill that process as non-owner.
dimka_nys's user avatar
1 vote

Can't remove /var/lib/docker due to "Device or resource busy"

Per a helpful comment from @bluescreen, this is what I found to work: sudo systemctl stop docker sudo rm -rf /var/lib/docker sudo systemctl start docker If docker is restarting after stopping, you ...
Mattwmaster58's user avatar
1 vote
Accepted

virt-install hangs and won't die. How to stop safely?

In my experience if something hangs that hard that plain kill is ignored, there isn't any friendly way to exit the hung applications. Maybe kill -9 will help, but if host reboot also hangs with ...
Cole Robinson's user avatar
1 vote

Kill a running process inside a docker

when you build Docker, use this command : RUN apt-get install lsof then in py file you can use: os.system("lsof /dev/nvidia* | awk '{print $2}' | xargs -I {} kill {}") REMEMBER: this ...
Ali Ganjbakhsh's user avatar
1 vote

ssh remote command: Killed by signal 15

I think what's happening here is that the pgrep -f "/usr/bin/nmon" is also matching the shell running that command, since it will find the string "/usr/bin/nmon" in the full command-line and you ...
filbranden's user avatar
1 vote

Is it safe to stop a Jboss EAP server with Kill -9?

According to official RedHat doc, signals SIGHUP, SIGINT and SIGTERM trigger gracefull shutdown. SIGKILL (kill -9) does not.
yntelectual's user avatar
1 vote

How to make a shell script return 0 even after getting killed

Depends on the signal. Bash allows you to trap with the trap command, but if your script is being killed with SIGKILL (9), it is uninterruptible and untrappable.
brent's user avatar
  • 3,521
1 vote

Find (and kill) old processes

If you have a Python/Perl/Ruby script you want to kill, killall won't help you since killall will just look for "python" or "perl", it can't match the name of a specific script. To kill all processes ...
Earl Ruby's user avatar
  • 429

Only top scored, non community-wiki answers of a minimum length are eligible