29
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 ...
9
votes
Accepted
cannot remove file, Device or resource busy
Its still mounted. I bet you see it if you run mount. If so run the following
# umount /var/lib/docker/aufs
# rm -rf /var/lib/docker
6
votes
4
votes
How do I kill processes older than "t"?
The problem
Converting etime (elapsed time) column of ps command to seconds. The time specification is in this format [[dd-]hh:]mm:ss. Newer versions of ps have an etimes column which outputs etime ...
4
votes
4
votes
Cannot kill VMware VM
After having identified the right process using
ps | grep vmx, you can abruptly terminate it via kill -9 <pid>
Be very careful to select (and kill) the right process.
For more information, ...
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 (...
3
votes
Cannot kill VMware VM
How can I identify the root cause for this very strange behaviour?
Scientific method is your friend.
Define the problem you want to solve. It looks like you have 2 (possibly interrelated) issues. ...
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
Accepted
Ubuntu server randomly kills Apache2 - I guess I know why
See man update-alternatives for a description of the alternatives system
This is the command being run on your system
update-alternatives --install /usr/bin/php php /usr/bin/php5 50
--slave /usr/...
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
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
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
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
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
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
how to stop for loop on another tty
You could try to use pstree to find shell where for executed.
For example, I run loop with command for i in {1..1000}; do sleep 5; done, then I do pstree -p | grep sleep, see output | -sshd(29695)--...
1
vote
Accepted
Killing process group safely
The parent has to explicitly wait() for its children if it cares about their termination state. By default orphaned children are transferred to init (pid1) and not terminated.
Unfortunately, when they ...
1
vote
Kill defunct xrdp session --- xrdp users cannot log on
FOr anyone that comes across this issue, I found that xrdp server stores some state information about disconnected sessions. Even parsing all the TCP connections and killing the listening but not ...
1
vote
Accepted
Long running PHP process randomly stops with message 'Killed'
Looks like the culprit was OOM-KILLER due to no-swap-left, evidence was left in /var/log/messages
Apr 17 05:29:31 Centos-PHP56 kernel: php invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0, ...
1
vote
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
...
1
vote
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/
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 × 125linux × 48
process × 43
bash × 13
centos × 9
kill-process × 9
windows × 8
php × 6
unix × 5
signals × 4
mysql × 3
ssh × 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