How can I kill a process and be sure the PID hasn’t been reused
Suppose, for example, you have a shell script similar to:
Suppose, for example, you have a shell script similar to:
I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some of my processes were Killed, as my terminal reported to me. Several programs had already successively completed before the programs that were later Killed started, but all the programs afterwards failed in a segmentation fault (which may or may not have been due to a bug in my code, keep reading).
I run command ps -A | grep <application_name> and getting list of process like this:
When I used killall -9 name to kill a program, the state become zombie. Some minutes later, it stopped really.
So, what’s happening during those minutes?
Are there alternatives to pgrep and pkill commands on Mac OS X or should I just create aliases for them using other commands available for me?
Suppose I have a thousand or more instances of any process (for example, vi) running. How do I kill them all in one single shot/one line command/one command?
I am trying to open Firefox in CentOS, but I’m getting the following message:
How can I kill a process based on its command line arguments?
killall, pgrep, and pkill seem to only work based on the process name.
In the man page, it says: kill [ -s signal | -p ] [ -a ] [ — ] pid … pid… Specify the list of processes that kill should signal. Each pid can be one of five things: 0 All processes in the current process group are signaled And I tried like this in … Read more
I am using Debian stretch (systemd).
I was running the rsyslog daemon in foreground using
/usr/sbin/rsyslogd -n
and I did a Ctrl+Z to stop it.
The state of the process changed to Tl (stopped, threaded).
I issued multiple kill -15 <pid> commands to the process, and the state of the process was the same: Tl. Once I did an fg, it died. I have 3 questions.