Questions tagged [kill]

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

91 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
1k views

Apart from USR1 and USR2, which signals can I safely use for custom interrupting behavior? (in python)

I have a complex application with USR1 and USR2 already defined as having a well-defined and not replaceable purpose. There are tons of different signals in linux. Might there be another one (maybe a ...
4
votes
2answers
757 views

Immortal SSH Session

I've got a little TurnKey Linux Debian Squeeze VM that I use for SFTP. I had a user login and transfer a file the other day and now I can't seem to kill the session. I'm still a little shaky in ...
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. ...
3
votes
0answers
945 views

File shows up in ls but cannot rm or mv, seems to be held by some unknown process

I do a lot of work on an SGE cluster running CentOS 7, and have recently had issues with jobs dying randomly, but seemingly with some processes still running that prevent me from cleaning up to start ...
3
votes
2answers
2k views

What is happening after kill -CONT <PID>?

I have suspend a process through kill -TSTP <pid>. Then tried to continue it with kill -CONT <pid>. But After completion of process, control is not returning to bash. Why this is happening?...
3
votes
1answer
5k views

Killed process blocks TCP ports

I've had this issue on several machines. Is there some way to free this blocked port? Here is an example: Let me explain. I've killed some JAVA-Process on SUSE Linux Enterprise Server 11 SP4, which ...
3
votes
2answers
1k views

Kill process by name

I am using bash to start several instances of one python program, like this: python example.py -id $i where $i is the id given to the instance. All the processes are started on the same user, and ...
3
votes
1answer
931 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
2answers
234 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 ...
2
votes
0answers
27 views

How do I send signal to all processes in a cgroup?

kill $(< /sys/fs/cgroup/freezer/<name>/tasks ) works, but looks clumsy, produces a warning if cgroup is empty and may hit command line length limit. pkill -F does not accept cgroup tasks file ...
2
votes
0answers
992 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 ...
2
votes
0answers
524 views

trapping signals without interfering with other signals

When trapping a signal in a shell script, the trap commands are not executed until the current command finishes. For example, consider the following shell script: #!/bin/bash trap 'echo "SIGTERM ...
2
votes
0answers
742 views

Killing processes in interruptible sleep state?

I'm inserting data from Server A, which is running a Node.js app, into a MySQL database on Server B. I first check for duplicate rows, and then INSERT or not depending on the result. This process can ...
2
votes
0answers
207 views

Running a process in a specified time window

Large computational tasks consume time and computational resources, therefore I am looking for a way to execute them in a specified time window using a shell script. I want to run the script batch.sh ...
2
votes
0answers
136 views

Dissable pid-namespace init process signal handler restriction

Ubuntu 16.04 / Linux version 4.4.0-47-generic / gcc version 5.4.0 I want to implement a container using linux cgroups and part of the implementation was to run the process into a new pid-namespace. ...
2
votes
1answer
472 views

Safely kill foreground process when a background process ends

There are two scripts, the first in the background, the second in the foreground: trap "ret=\$?; rm -f pipe1 pipe2; exit \$ret" EXIT INT TERM QUIT my.bin > pipe1 < pipe2 & my-term.sh pipe1 ...
2
votes
1answer
2k views

Kill a running shell script, and kill all process running within it

I have a shell script running in the background, which runs 5 different jobs. When I run the shell script all 5 jobs start running in order. When I kill this shell, whichever process is running, will ...
2
votes
0answers
515 views

killall doesn't work if I call it from a script

I'm starting a tcpdump inside a script and I also kill it from the same script. So I'm currently using the killall command for this: The script gets executed from an udev rule: This is the section, ...
2
votes
0answers
1k views

Catch the kill signal when a process is in S state [interruptible sleep]

This is the process group : (ps -ejH) xxxx xxxx xxxx ? 00:00:00 sshd yyyy yyyy yyyy ? 00:00:00 sshd 8713 8713 8713 pts/0 00:00:00 bash 1234 1234 1234 ? ...
2
votes
0answers
112 views

In AwesomeWM, is the use of `c:kill()` as soft as clicking on the red cross in another window manager?

In AwesomeWM, windows are closed with the method c:kill() (bound to Meta-Shift-c) When I use that key binding, the window just close instantly! Therefore I wondered : Is that way as soft as ...
2
votes
1answer
216 views

Guard against killing an already killed process

I'm writing a script that tries to kill a process. But the process might already been killed by others. How can I guard against it and prevent this kill command from terminating my process with ...
1
vote
0answers
24 views

Can't kill process .gytm

Using Centos 7 I have a problem with a process that cannot be killed. When I run htop, it appears as "/usr/sbin/cloud-agent -k start" and when I run top the process is: .gytm When I kill ...
1
vote
0answers
46 views

Get cursor back after killing xkill

Assume that you accidentally typed xkill on a terminal and you killed by Ctrl+Z or Ctrl+X. Now the cursor is an X and it doesn't really function. How can I get the cursor back without rebooting the PC?...
1
vote
0answers
121 views

Send SIGINT to a command launched inside bash script

I am executing a bash script and I want to correctly terminate a command (by pressing CTRL+C) that I am launching inside the script. This is the script: trap ctrl_c SIGINT function ctrl_c() { PID = $!...
1
vote
2answers
59 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:...
1
vote
0answers
111 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
vote
0answers
295 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 ...
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)...
1
vote
0answers
225 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 ...
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 ...
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 ...
1
vote
0answers
115 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 ...
1
vote
0answers
269 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 ...
1
vote
1answer
1k views

How to kill off these processes?

Problem I have by mistake initiated a PHP background process script that calls itself and has now created an infinite loop of calling itself over and over. It currently sends an email to my Gmail ...
1
vote
0answers
144 views

could getaddrinfo or connect call get a process into D ( uninterruptible state )

It happened a few days in a row that one of our process couldn't be killed by "kill -9". The kill -9 used to be able to kill this process on daily base reliably for past 2+ years. This process has ...
1
vote
0answers
1k views

Kill running process

I own some old processes on a shared compute server. They consume a lot of CPU and according to htop they're in the running-state: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ ...
1
vote
0answers
458 views

When I killed tty1 root user on ubuntu14.04,the system reboot. Why?

When I enter who command in the shell, i got this: root tty1 2017-04-01 12:21 langxiaowei pts/2 2017-07-21 18:05 So, for the safe, I want to kill the root user. Then I enter the comamnd ...
1
vote
1answer
798 views

Start python http server which can be stopped by anyone else

I would like to start a python SimpleHTTPServer instance but I would like to give the ability to everyone to stop it (execute kill -1). It wouldn't be a big deal to solve but I don't have the access ...
1
vote
0answers
162 views

“Task manager” for killing hard-disk intensive processes?

Sometimes I want to be able to quickly kill the process that has the most intensive hard disk usage. How do I do it? With the solutions described here I would have to open another terminal to invoke ...
1
vote
0answers
324 views

Work with setsid to open a session and close it correctly

I would like to create the following script: -- run a python script with setsid -- python may or may not fail with exception -- check if all of the group processes were terminated correctly -- if ...
1
vote
0answers
674 views

varnishd killed by OOM, How can I configure the varnishd to avoid this problem?

The following error message is taken from my log message. varnishd server is getting killed for over use of memory. We have done all the possible settings to avoid it, Still the same problem happens ...
1
vote
1answer
832 views

How to kill all sessions for a Linux user except first one, and limit users to one login session

I need to know how to kill all processes for a logged in user except the first one in linux redhat 6. for example, AZain user is logged in multiple times from different machines so I need to allow ...
1
vote
0answers
449 views

What is the difference between the SIGHUP generated by typing “exit” in the SSH shell terminal vs clicking the “X” button in the PuTTY window?

Referring to this question, I am trying to use nohup <command> <arg> & to continue to run a command in the background after I logout from the SSH shell terminal. However, the ...
1
vote
0answers
701 views

Why do interrupted processes show up in nvidia-smi?

When ​I kill processes in terminal using C-c and run nvidia-smi, the process are still shown as "compute processes". These processes are no longer in the top resu​lts. I have to kill -9 to clean them (...
1
vote
0answers
256 views

killing subprocesses and traps

I have the following two scripts which simulate some work: start.sh simply launches 2 (mpi) processes with script mpiproc.sh. start.sh #!/bin/bash function trap_with_arg() { func="$1" ; shift ...
1
vote
0answers
607 views

CentOS Running process not responding to kill signals and not context switched

An updatedb process on my linux server is not responding to kill signals. (kill -9 or SIGSTOP) [root@chroot-1 ~]# ps auwx | grep -i 4505 root 4505 99.5 0.0 59544 1256 ? RN 09:43 112:...
1
vote
0answers
1k views

program “killed” as soon as it runs

Ubuntu 12.04 I have success with make, and output a program name algo. When I type ./algo,the terminal just directly shows 'killed' And I searched the var/log/message or syslog kern.log. I don't ...
1
vote
0answers
467 views

Why process is killed while a lot of memory is free?

I am running a python script in ipython. This script will take about 8GB RAM. The system has more than 80 GB free RAM but the swap is nearly 0. My script was killed after it runned for a while. I want ...
1
vote
0answers
873 views

Stop all processes by a user: children of supervisord are still running

I'm trying to delete a user but it keeps saying that user is currently used by process ID x I tried everything here and here, nothing works, how do I kill all the process by a certain user in order ...
1
vote
0answers
839 views

pkill -P $ID working while kill — -$ID not

I was playing around with creating and killing process groups on linux ( ubuntu ) I am trying to kill a process group and am being driven crazy by the fact that pkill -P $ID works while kill -- -$ID ...