Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [kill]

kill - Send a specified signal to a process or process group.

0
votes
2answers
44 views

Why I killed apache user, but it still display?

I am using CentOS 7, Nginx, I don't want use Apache httpd. Then I kill user apache pkill -9 -u apache pkill -KILL -u apache then I check again, I still see user apache. How to kill all process what ...
0
votes
1answer
33 views

Stop multiple processes from command line correctly

I'm executing the following command on mac ./node_modules/.bin/webpack --watch & nodemon dist/server.js I tried killing the processes using Ctrl+C however i still notice that node processes are ...
0
votes
3answers
52 views

How do we write script to kill PID ( If else loop )? [closed]

I have a file which will contain multiple PID's as show below. #cat /scripts/pid_$DATE.txt 12345 23456 34567 45678 I have to write a script which will read the PID's from above file one by one and ...
1
vote
1answer
21 views

Killing two-part process with && by PID

I have a bash script where I am sleeping and then executing a command in a background process. For example sleep 30s && ./script.sh & If I grep ps for "sleep 30s" and kill the process ...
2
votes
1answer
48 views

Why is “A stop job is running” a good design choice?

In a typical modern Linux distribution, the user may experience this when trying to shut down the computer: "A stop job is running for Session c2 of user", or equivalent. Now, I understand the idea ...
0
votes
0answers
73 views

How to stop/kill thread in process

I see all of threads according process with ps -T Is there any way to kill/ stop specific thread(not all the process) by thread id/thread name? I prefer with shell script but if it impassable so in ...
3
votes
1answer
93 views

Why does `kill` not appear to be a Bash builtin? (it should be) [closed]

The Internet is unanimous: kill is a Bash builtin. Bash changelog says the same. However my other builtins apparently think otherwise: $ builtin kill bash: builtin: kill: not a shell builtin $ type ...
4
votes
4answers
73 views

Shell Script -kill all process by name but me

I have shell script test.sh that I running. I want that in the beginning of this script ,if there are older test.sh that running ,kill them first. If I killall test.sh the newest process killed too....
0
votes
1answer
59 views

kill gnu parallel inside a bash function

I am using gnu parallel in a subshell function, e.g., func()( parallel --will-cite sleep ::: 60 ) upon sending SIGTERM to the function I want parallel to be killed too. But I get $ func & [...
1
vote
1answer
19 views

How do I run multiple processes with the same process group id?

I am learning how to use the killpg syscall. So for an experiment, I want to start two new processes with the same pgid and then attempt to kill them using killpg. I read about setsid so I tried ...
0
votes
1answer
28 views

How to kill all instances of a program running apart from the newest one

I have a problem whereby my script keeps spawning new ssh processes. This shouldn't happen I know, but I would like to clean the old ones up from time to time. If I do : ps -ef | grep "ssh" | awk ...
0
votes
0answers
55 views

Why can I not kill a process in the same line I start it using fuser?

I have been trying to kill a process by looking at the listening port and nothing seems to be working. The code is as follows: (code to open port 8545) && fuser -k 8545/tcp I also tried with ...
0
votes
1answer
54 views

Kill -9 problem in bash file

I wrote a 2 line bash script file in Centos 6.8 #! /bin/sh pid= ps -ef | grep -i 'adminserver' | grep -v grep | awk '{print $2}' kill -9 $pid when I run the script i get the following output: kill: ...
0
votes
0answers
24 views

Unix Commands not working from Crontab [duplicate]

I have this command in a bash script called run.sh kill $(lsof -t -i:34445) On a terminal when i run this script using bash run.sh it works. However, i am using crontab to schedule this command. ...
0
votes
1answer
334 views

Kill remote process via ssh

I have a process that I want to kill remotely. I tried ssh remotehost "kill -9 $(ps -aux | grep foo | grep bar | awk '{print $2}')" but this returns the error kill: usage: kill [-s sigspec | -n ...
0
votes
0answers
33 views

Can I safely reduce CPU usage with kill -SIGSTOP?

I have 7 differents workspaces and each of them have a different purpose. But everything runs in the background... For exemple the workspace 5 with my browser is using CPU even when I'm on workspace ...
0
votes
0answers
47 views

Background process gets killed in ubuntu 16.04 server

I have a spring boot application and i'm running it as ROOT through this command: mvn spring-boot:run -Drun.jvmArguments="-Xms512m -Xmx1024m" > lms_logs.log 2>&1 & After a few hours ...
2
votes
1answer
86 views

Why doesn't ctrl+u send SIGKILL? stty says it should

I can interrupt a program by pressing ctrl+c in the shell. Often this kills the program but some programs trap the signal and keep running. I want to be able to kill such programs more aggressively ...
2
votes
1answer
148 views

why sometime need to stop process by kill -9

we have kafka machines in hadoop cluster the script that stop the kafka process do the following kill PID but we notice that the script that stop the kafka not really kill the process therefore we ...
0
votes
0answers
54 views

Is it possible to distinguish signal from kernel at reboot and at kill from terminal

As I know, we can send a signal SIGTERM to a process by pressing ctrl+c or by using pkill -f processName. Also, when we reboot or shutdown, the kernel will send SIGTERM to each process too. So I'm ...
-2
votes
1answer
43 views

How is “some other pending, unblocked signal” involved when a process sends a signal to itself?

Advanced Programming Unix Environment says: #include <signal.h> int kill(pid_t pid, int signo); ... If the call to kill causes the signal to be generated for the calling process ...
2
votes
2answers
200 views

Run commands in parallel, but kill both if parent is killed?

Is there any way to run two commands in parallel in Bash such that, if the shell is killed forcefully, then both of the commands are guaranteed to be also killed? A simple & won't work because if ...
2
votes
2answers
86 views

Catch which user sends kill signal

Say I'm running some script that just sleeps, and another user with admin rights tries to kill my script using pkill. How can I catch which user sent that signal to my process, if such a thing is ...
1
vote
0answers
40 views

Killing a process when some other process is finished

Given a | b, i'd like to kill b when a is finished. b is an interactive process, which doesn't terminates when a is finished (fzf in my case), and the whole a | b is executed in a $() subshell. So ...
0
votes
0answers
107 views

Cannot kill my lsof processes even as root

My lsof is hung so bad that I can't even kill -9 it. Initially, it was owned by another process, foo. I tried killing foo, hoping that lsof would also go way. But while I was able to kill -9 foo, now ...
1
vote
1answer
242 views

SIGUSR2 question

I am CentOS 7.4 on Dell servers. Running this command in a script: kill -SIGUSR2 `ps -ef|grep ${rule}/etc/suricata/suricata.yaml|grep -v grep|awk '{ print $2 }'` The "ps" part here grabs PID. What ...
39
votes
1answer
5k views

What does a program do when it's sent SIGKILL signal?

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?
1
vote
1answer
175 views

Process started by script does not receive SIGINT

I am on Ubuntu 16.04.5 LTS (AWS) I am creating a python process via this command: nohup python -u main.py > nohup.out 2>&1 & I would like to send a ctrl-c/SIGINT to the process, so I ...
0
votes
3answers
609 views

Stop/kill a process from the command line after a certain amount of time

I have a Python code which listens and detects environmental sounds. It is not my project, I found it on web (SoPaRe). With the ./sopare.py -l command, it starts recording sounds but in infinite loop. ...
1
vote
1answer
65 views

killall for this terminal only

When debugging I often use killall to kill a process. This is really a bad habit because there might be more processes running of the same name on the system. Normally the process I want to kill is a ...
1
vote
3answers
63 views

Quickly kill processes containing word

$ ps aux | grep ruby user 1565 3.7 0.1 4307464 17696 s000 S+ 7:31AM 0:00.61 /Users/user/.rbenv/versions/2.3.1/bin/ruby bin/rails c user 1579 0.0 0.0 4268020 ...
5
votes
2answers
2k views

Why can't I kill a `Sl` process?

On Lubuntu 18.04, I open pcmanfm $ pcmanfm . and after looking at the thumbnails of the image files under the current directory in pcmanfm, I closed the window of pcmanfm by Alt-F4, but it is still ...
0
votes
0answers
136 views

Kill a process inside docker in a “R” state

I'm having a process on my server that I can't kill, even with kill -9. It's in R state in top and in ps, and it's running inside docker. It's a ls I've started in a very large folder. It's taking ...
5
votes
1answer
561 views

What is the differences between “kill -PIPE $$” vs. “exit 1”?

In my Bash script, I used the following syntax in order to exit from the Bash script: kill -PIPE $$ I use it because sometimes in a function or in an internal shell in the script, the exit 1 does ...
0
votes
2answers
76 views

“kill -l” only returns ZERR

While trying to send SIGQUIT I got this: $ kill -s QUIT 4341 kill: unknown signal: SIGQUIT kill: type kill -l for a list of signals And I was very surprised to see this: $ kill -l ZERR So, ...
1
vote
2answers
294 views

Difference Between bg and kill -CONT

I was running an application in the foreground, and put it in the background by hitting CTRL+Z (and stopped). To get it back running, I ran the command bg %1 (which is its JOBSPEC). I thought why not ...
0
votes
1answer
25 views

Tagging a process so I can kill it later easily by identifying

I need to tag a generic process (I don't really control the command being run). Could I do something like this: run_special_cmd(){ "$@" -- --very-special-command } run_special_cmd sleep 5000 &...
2
votes
2answers
745 views

what does the TSTP stand for in killing signals?

I know that the TSTP will stop the process that were executing, and the signal id is 20, and it's equal to ctrl+z. I searched for the abbreviation, but i didn't find anything! anybody know?
0
votes
1answer
71 views

The /bin/ prefix to kill command is getting rid of the error message

I have Debian Stretch.. I thought that a regular user could kill root process as root. I was using the command /bin/kill 10733 as the user. There wasn't any error message. Then, I typed out the ...
0
votes
3answers
507 views

How to send SIGINT to multiple processes

I am trying to send the SIGINT signal to multiple processes, I think this is right: kill -2 <pid1> <pid2> ... <pid3> but I cannot confirm that...
1
vote
1answer
341 views

How can I kill all child processes of a certain process from the command line?

I run both regular Chrome and Chrome Canary (from now on, Canary). Sometimes I want to kill all subprocesses, Google Chrome Helper, of Canary. The problem is that they have the same name as the ...
0
votes
2answers
88 views

Kill process by fuser instead of pidfile?

Recently I developed the habit of killing processes with fuser -k -n tcp $PORT which can hardly kill the wrong process. I prefer this over fiddling with a pidfile that may or may not be still there ...
-1
votes
1answer
57 views

Bash: How to escape minus in `if [ … ` (alias “test”)?

I need to test this: kill -0 $LAST_PID; So I wrote if [ kill -0 $LAST_PID ] ; then ... But this results in an error - unknown operator after - or so. how do I escape the options within if?
-1
votes
1answer
544 views

How to kill a process in a top?

Unlike htop -- top is more difficult for me and I would to know how to kill any process in top ? Thank in advance my Stackoverflow friends !
0
votes
1answer
423 views

“Killing” a zombie defunct process without killing its parent

I know there are hundreds of questions on "How to kill a defunct process" but in all of those I found the final answer was: "Don't worry. They don't use any resources." and that basically you either ...
2
votes
1answer
402 views

How does systemd stop services that don't have a unit file

Systemd can inherit orphaned processes, and there are other ways a service can be running without having a unit file for the given service. I want to know what the catch-all is for services that don'...
3
votes
2answers
204 views

Kill the command based on the `grep` output? [closed]

We have a command-line interface to logon to a system like so: $ cli -u username -p password In case if the wrong password is provided the message we get is " Credentials incorrect" and then it ...
5
votes
1answer
5k views

Unable to kill process with PID 1 in docker container

I have the following Dockerfile for creating a container with a powerdns recursor in it: FROM debian:stretch-slim ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ apt-get ...
0
votes
2answers
1k views

Get python process ID for a flask web site and/or port number?

I have some web applications that I wrote with python flask. I know which port I started each one on and each was started using nohup. Each one was started with something like nohup python mywebapp.py ...
1
vote
2answers
460 views

Stop endless loop .sh script

I have a script like the one below, hosted on an SSH server: while true do python3 main.py sleep 1 done I have run it with: nohup ./launcher.sh I can kill the python processes using top but of ...