Questions tagged [kill]

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

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

Killed tmux pane continue running foreground script

A little curiosity. A vanilla tmux session (stock config) had 1 pane. The pane was executing the following command: sleep 1d; shutdown -h now. 1h into the execution of the "sleep" command, ...
1
vote
0answers
109 views

Running script on .xprofile fails to execute

I'm trying to run a login script executing a desktop audio visualizer (glava) on .xprofile but I am running to a few problems: First of all the script (on ~/.local/bin/glav): #! /bin/sh nohup glava --...
-1
votes
1answer
36 views

Why does the shell not terminate by kill -s TERM?

#!/bin/sh trap 'trap - EXIT; echo exit' EXIT trap 'echo term; exit' TERM sleep 100 If I run kill for the PID of the shell process of the script, it does not terminate. If I remove the TERM trap, ...
0
votes
1answer
30 views

Why do certain processes keep jumping to higher PIDs?

Sometimes when my vscode hangs up, and I have to force-quit it, it is as though it will not start back up again until I restart my computer. Before shutting the computer down I tried looking for its ...
0
votes
0answers
128 views

How to get cron to pkill my java process?

I have a cron job that runs to detect if a certain application has frozen. If so it should kill the frozen application and restart it. The application is a Java program. When the application is frozen,...
1
vote
1answer
32 views

When using kill -CONT, where will the process pick back up?

I'm planning on using to kill -SIGSTOP and kill -CONT to pause data collection over a given time frame. I'm wondering if when I invoke kill -CONT, will the data collection start from when I stopped ...
1
vote
1answer
108 views

Cannot kill children on trap

I am stuck with something unexpected to me: I am trying to make a chat script and set to call function on 'Ctrl+Z' trap 'chat_unloop' 20 But in the code I have some rows that starts child ...
3
votes
0answers
1k views

OS linux ubuntu is killing my mongod service

I am facing this issue consistently, whenever I run some CPU and memory intensive processes so OS kills my mongod service. Due to which service goes into the failed state and everything stops. ...
0
votes
0answers
25 views

Strange behavior of bash and SIGTERM with Ubuntu [duplicate]

Here's what happens in Ubuntu (Linux ubuntu 5.3.0-53-generic #47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, bash 4.4.20(1)): In Terminal, open a window (let's call ...
0
votes
1answer
70 views

How to force kill program stuck while accessing IO (firefox)

I use firefox to display some files over an sshfs mountpoint... However, it happens that this mountpoint gets disconnected; if I inadvertantly reload a page, firefox will be forever stuck and cannot ...
0
votes
0answers
25 views

How to create a process like Redis that can not be killed [duplicate]

I just intalled Redis on my Ubuntu. After starting it, I get a process below: me@X86-Xenial-2:~/edgex-go/bin$ ps aux | grep redis redis 7366 0.0 0.0 38852 8832 ? Ssl 10:53 0:00 /usr/...
0
votes
1answer
40 views

Permanently close a port in Bash

I am trying to kill a process (in CentOS) that is listening to a port that was set up with port forwarding. I have tried all the answers here: https://stackoverflow.com/questions/9346211/how-to-kill-a-...
0
votes
1answer
154 views

Processes with states R and Rs not killable with kill -9

I started some processes from my local machine (using PyCharm) and also by accessing the remote machine with ssh. Now I have multiple processes with states R or Rs that are not killable. If I use ...
0
votes
1answer
43 views

kill and suspend job in 1 command

I'm trying to kill and suspend 2 seperate jobs in one command. $ jobs [1] Running ./jobs2 & [2] Running ./jobs1 & [3] Running ./...
1
vote
1answer
45 views

Let an unelevated user kill all his processes successfully

Situation I have set up an environment where users can login from multiple endpoints and use tmux, screen ... so when they end their work they can either logout of their ssh session which doesn't ...
0
votes
1answer
53 views

Pid of process in loop launched by script

I have a number of processes launched via a bash script, listening for and playing, via netcat, audio streams arriving on separate ports: #!/bin/bash # listener.sh while : do nc -l 900$1 | aplay ...
0
votes
2answers
96 views

Kill running instances of processes except which is triggered due to current command executed

I've to kill all running instances of Xvfb using shell script hence have following code - for pid in $(ps -ef | awk '/Xvfb/ {print $2}'); do kill -9 $pid; done It kills all instances but one fails ...
1
vote
0answers
288 views

unable to kill process in AIX 6.1

Below is the script I have that generates 180320.tar file cat Bckup.sh tar -X ./exclude.txt -cf /backup/180320.tar ./1043 gzip /backup/180320.tar While this script was running, I force deleted the ...
0
votes
1answer
863 views

How can I send specific (SIG) signal to systemd?

On systemd's manpage, there is a section called Signals, that talks about different signals and how they affect the system. For example, SIGRTMIN+3 reboots the system: SIGRTMIN+3 Halts the machine, ...
1
vote
1answer
422 views

How to get pkill to output process information of killed process?

How to get pkill to output process information of killed process? I don't see anything in man pkill that suggests this is possible. I know I can do a pgrep and process the list and then pipe that to ...
0
votes
1answer
156 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
463 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(...
2
votes
0answers
970 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
41 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
288 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
74 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
112 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
284 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
265 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 ...
-1
votes
1answer
56 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
1answer
161 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
132 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
222 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
663 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
161 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
4k 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 ...
2
votes
2answers
107 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
443 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 ...
3
votes
1answer
923 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
117 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
99 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
23 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 ...
2
votes
2answers
2k 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
1k 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
198 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
85 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
609 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
195 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 ...
3
votes
2answers
233 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 behind ...
3
votes
1answer
326 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 ...

1
2
3 4 5
13