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 ...
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 (...
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 ...
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
...
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/
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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.
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.
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
kill × 126linux × 48
process × 44
bash × 13
centos × 9
kill-process × 9
windows × 8
php × 6
unix × 5
signals × 4
ssh × 3
mysql × 3
debian × 3
powershell × 3
java × 3
command-line-interface × 3
cpu-usage × 3
remote × 3
gnu-screen × 3
ps × 3
pid × 3
ubuntu × 2
sql-server × 2
docker × 2
logging × 2