Questions tagged [kill]

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

Filter by
Sorted by
Tagged with
0
votes
4answers
83 views

How to avoid killing a wrong process when using PID number for killing?

I'm starting a long-running background process inside a Bash script. I'm saving the PID number after sending the process to background and since that process has that PID number as long as it runs, ...
0
votes
0answers
7 views

Kill background process bash not working from current shell [duplicate]

I'm doing trap to kill subprocesses of script and it's working perfectly: myscript.sh trap "kill 0" EXIT ./someProcessA & ./someProcessB & the problem that I don't understand why ...
0
votes
0answers
47 views

Why bash need job control?

Why Unix systems need job control? So for example, we can use the process number or job number(jobspec) with the kill command. $ sleep 101 & [1] 19 $ sleep 102 & [2] 20 $ jobs -l [1]- 19 ...
1
vote
2answers
49 views

How to terminate a piped command?

Let's say there is a simple script named action.sh: #!/bin/bash echo -n 'a' | nc a.b.c.d p action.sh here puts an a character to a.b.c.d address. However, nc can hang sometimes, and I want to kill it:...
0
votes
1answer
36 views

Can't stop script l loop with exit command

I've got a debug function in my script (that runs via nemo.action) that uses zenith popup to ask if the user want to stop or continue when an error occurs. However, when this happens inside a loop, ...
0
votes
0answers
36 views

How to kill a Python process within an SSH session

This question involves running a bash script, say helloworld.sh, which executes an MPI mpirun command which in turn runs a Python program, say helloworld.py, using mpi4py. The bash command is used in ...
0
votes
1answer
25 views

Automatic Process kill process problem

I am using MX linux for a few days and I found a problematic behavior. Suddenly sevaral processes were killed automatically. For this, I had to face many problems. Is there any way to stop it? I don't ...
0
votes
0answers
51 views

Cannot kill process nomachine nxnode.bin

Almost every time, when I resume system from sleep mode, after login again with nomachine (remote desktop) I have: process nxnode.bin with R (realtime?) and 100% CPU usage. This makes impossible ...
0
votes
1answer
29 views

Why is a process being shown while using “jobs” command after killing the process manually?

Why is the parole(just a media palyer) still listed in the "JOBS" command output even after killing maually and why is not listed in the "PS" command output ? Does this mean the ...
3
votes
1answer
47 views

kill %1 equivalent in fish

In bash, if I run kill %1, it kills a backgrounded command in the current shell (the most recent one, I believe). Is there an equivalent of this in fish? I haven't been able to find it online in a bit ...
0
votes
0answers
21 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
52 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
33 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
27 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
49 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
29 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
38 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 ...
0
votes
0answers
271 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
21 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
24 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
12 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
31 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
34 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
34 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
38 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
30 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
50 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 ...
0
votes
0answers
28 views

Getting more info about Linux process

I've realized that I have dozens of processes running on my machine which I didn't expect to have. I've been using podman for Docker so a lot of these tasks are for podman; however, I'm having trouble ...
1
vote
0answers
97 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
236 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
182 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
0answers
12 views

Does restarting cinnamon close processes that are currently running?

My computer running Debian with the cinnamon desktop environment and is saying 'Cinnamon has crashed'. I have several processes that I have currently running that I do not want to kill. Will ...
0
votes
0answers
50 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
80 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
216 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
35 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
394 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
36 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
175 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
68 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
83 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
143 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
160 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
72 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
37 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
128 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
73 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
135 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
392 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
91 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
2 3 4 5
12