Questions tagged [kill]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

killall gives me `no process found ` on a mac

I am a bit confused as the same command works on linux which does not work on my mac in a Ubuntu Linux docker container. root@9xxx:/app# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT ...
0
votes
1answer
37 views

How to kill a subprocess shortly after called from parent programmatically?

How can I terminate a process that is launched from within an application programmatically? To clarify, there is an application that launches a WebKit subprocess from time to time, and I want to kill ...
0
votes
1answer
60 views

Difference between Ctrl-C and kill -INT?

I have a signal handler in C++ program: void term(int signum) { cout << "in term" << endl; # Do Stuff exit(0); } int main(int argc, char *argv[]) { # Do Stuff signal(...
0
votes
0answers
24 views

How to kill a child process like TAR + XZ running from POSIX master script but called from BASH terminal prompt by a signal?

My script is (at the core) running this part, which obviously takes a long time if input_dir is large enough: XZ_OPT='-9 --extreme --threads=8 --format=xz --check=sha256 --verbose --verbose' \ tar --...
2
votes
0answers
71 views

Unable to kill / terminate programs if another terminal window opened

I’m running a program on raspberry pi which opens few other python programs for a certain amount of time and then closes them. What is happening: if I’m running the main program from e.g. Python 3 ...
0
votes
0answers
33 views

How to terminate a process when kill -9 doesn't work? [duplicate]

I've seen a few cases of processes that don't respond to kill -9. Most recently, I've seen both lsusb and reaper get stuck and be unresponsive to kill -9. (After trying all the usual signals first) ...
1
vote
1answer
72 views

How to kill all background jobs in dash?

Simply kill $( jobs -p ) not work in dash. For example in dash: $ sleep 999 & $ kill $(jobs -p) dash: 2: kill: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or kill -l [...
1
vote
0answers
67 views

What if 'kill -9' still does not work?

Despite kill -9 $PID should work always, it sometimes does not. At least I have some encounters to recall. Yesterday I got one such: I had a problem with my SD-card and I wrote it over with zeroes (dd)...
0
votes
1answer
72 views

Explanation for the command “kill -n 9 0” [duplicate]

I am searching kill command's full manual, but in man kill or even with Google, I cannot find this command's meaning below: kill -n 9 0 I am sure it has a very easy answer.
0
votes
2answers
59 views

kill( ) won't stop subprocess if done from process started by /etc/rc.local?

On a raspberry pi (a recent raspian) I wrote an application that, on demand via network request, spawns an application, and on demand via different network request, kills it. The spawning mechanism is ...
2
votes
1answer
59 views

Stop sshd and kill ongoing connections

Under certain conditions, I want the sshd daemon to be stopped. When I do this, I want the currently open connections to be stopped too. By default, the sshd service does not kill existing connections ...
0
votes
0answers
57 views

Terminate a subshell background process

I am starting entr as a subshelled background process as described in its man page to listen to changes to some file foo, occuring during interactive use of some program baz, and I would like to ...
-1
votes
1answer
32 views

take action once background script is killed

I have below script running as background process. #!/bin/sh while true; do : done email_kill_alert() { echo "" | mailx -s "scritp received kill signal." emailid } Above script is run as background ...
0
votes
0answers
45 views

System process running in R state, strace doesn't show any output and isn't killing it -9 [duplicate]

So as in image the process running in R state. Not able to kill them with kill -9. Also strace isn't showing any output. What can be the reason for this and is there any option other than restarting ...
0
votes
1answer
101 views

Using the “kill” command in Ubuntu

I was running a simple script that would take the output of the kill command and print it onto a file. However, while experimenting for better/more in depth or interesting results, I realized that the ...
0
votes
1answer
40 views

Is nohup supposed to kill my script process?

I got a script that I'm trying to run with nohup: nohup /home/user/script.sh& If I run ps -a I can still see the process but if I close the terminal and run ps -a again the process is not there. ...
1
vote
0answers
66 views

How can/should I kill masscan process

I host a small Ubuntu server with DigitalOcean and recently realized a guest user was compromised. I have been trying to cleanup up my server to stop future attacks and have come across a process ...
0
votes
1answer
133 views

How to get list of processes from N days ago from ps output

How to get list of dates from an output of ps command to only show those processes beyond 30 days? My goal is to kill these processes. I can easily do this by killall command. E.g. killall -u user --...
0
votes
0answers
51 views

Reusing TCP port of a killed process

I have a TCP server process on Linux. It sometimes gets killed by SIGKILL, after which its parent restarts it. I cannot change the way the child is killed. Sometimes (about once per 100 times) the ...
1
vote
0answers
948 views

Killing a process running executed with sudo without using sudo in kill command

So I have a server, and I have access to sudo to do one thing only: run a single whitelisted script (I'll call it the target script). I do not have access to sudo anything else. Problem is, this ...
1
vote
2answers
50 views

Kill script, but allow currently executing program to exit

I have a bash script runs a command in an infinite while loop. The script looks something like: while : do python3 my_program.py done Is there a simple way to terminate this while loop from the ...
0
votes
2answers
242 views

KILL process with input as process name and time

I am trying to write a shell script to kill a specified process if it runs more than specified time and get process information before killing. Note: Script should take process name and time as ...
0
votes
1answer
323 views

Kill a stuck process in running state

I am trying to kill a du -mh command that has been stuck running for 18 hours. I have tried many kill signals kill -15, kill -2, kill -9 as root but with no luck. Are there any other techniques to ...
3
votes
1answer
66 views

Killing a middleman server started by bash script?

I have a bash script that looks like this: bundle exec middleman server & node script.js && kill -9 $(lsof -i:4567 -t) && bundle exec middleman build --verbose Right now, the ...
2
votes
1answer
42 views

I have a process (left) that is stuck, and I can't kill it. (kill -9 does not work), what to do?

I have a process that I ran under a Tmux session that I cannot kill. I have tried kill, kill -9, and a few other kill numbers, without it having any effect. I killed the tmux session successfully ...
1
vote
0answers
19 views

Killing extra instances of a service and getting notified about them

I have 2 Ruby-on-Rails applications running on my server. Their deployment is automated through Capistrano. The applications uses Sidekiq for processing background jobs. I use two individual scripts ...
0
votes
2answers
342 views

Is there any danger in using kill -11 instead of kill -9?

I've realised recently that the kill utility can send any signal I want, so when I need to SIGKILL a process (when it's hanging or something), I send a SIGSEGV instead for a bit of a laugh (kill -11 ...
0
votes
0answers
64 views

SD card mount Problem “ext4” -o “uhelper=udisks2,nodev,nosuid” “/dev/mmcblk0p2”

I was extracting one tar.xz file via my Raspberry SD card, so the process must be completed after a long time but when I wanted to unmount the SD card I get one error which one other program (the ...
0
votes
0answers
482 views

Node processes keep restarting

I'm currently running a few node processes on PM2, but when I stop them with pm2, then run ps -ef | grep node, it shows the processes as still running. One of them is an express application that ...
0
votes
2answers
91 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
54 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
162 views

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

I have a file which will contain multiple PIDs as show below. #cat /scripts/pid.txt 12345 23456 34567 45678 I have to write a script which will read the PID's from above file one by one and kill ...
2
votes
1answer
142 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
2answers
111 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. I understand the idea ...
0
votes
0answers
295 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
157 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
226 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....
1
vote
1answer
249 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
92 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
46 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
82 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
67 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
48 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. ...
1
vote
1answer
3k 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
69 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
118 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 ...
3
votes
1answer
157 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
372 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
99 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 ...
-1
votes
1answer
79 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 ...

1 2 3 4 5 11