The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [process-management]

Use this tag when the topic is about system process management. Commands used for this are like ps and kill -9 xxxx and service xyz start|stop|restart and htop, for example. Often used in conjunction with memory management.

Filter by
Sorted by
Tagged with
401
votes
9answers
164k views

When should I not kill -9 a process?

I am always very hesitant to run kill -9, but I see other admins do it almost routinely. I figure there is probably a sensible middle ground, so: When and why should kill -9 be used? When and why ...
91
votes
3answers
15k views

How does Linux “kill” a process?

It often baffles me that, although I have been working professionally with computers for several decades and Linux for a decade, I actually treat most of the OS' functionality as a black box, not ...
54
votes
3answers
16k views

Getting a window's PID by clicking on it

Is there any package which shows PID of a window by clicking on it?
49
votes
4answers
23k views

What's the difference between pkill and killall?

I know that pkill has more filtering rules than killall. My question is, what is the difference between: pkill [signal] name and killall [signal] name I've read that killall is more effective and ...
45
votes
2answers
5k views

Why is the default process creation mechanism fork?

The UNIX system call for process creation, fork(), creates a child process by copying the parent process. My understanding is that this is almost always followed by a call to exec() to replace the ...
44
votes
1answer
73k views

What does this process STAT indicates?

If you check the STAT column in above image you will see Ss S S< SN and R+ What does this indicates ? Process states. If yes,Then what is the significance of 'Ss S< SN and R+'?
38
votes
1answer
5k views

What is a “subreaper” process?

The word "subreaper" is used in some answers. Searching Google also turn up entries where the word is "just used". How can I understand what a "subreaper" is?
37
votes
6answers
7k views

Is there a way to pause a running process on Linux systems and resume later?

I have to copy files on a machine. And the data is immensely large. Now servers need to serve normally, and there are usually a particular range of busy hours on those. So is there a way to run such ...
31
votes
4answers
20k views

Is there a top-like command that shows the network bandwidths and file accesses of running processes

For example, we'd like to see: PROCESS IF TX RX FILE(regular) R/W prog1 eth0 200kB/s 12kB/s -- -- wlan0 12kB/s 100kB/s -- ...
30
votes
4answers
37k views

How to Throttle per process I/O to a max limit?

I'm looking for a way to limit a processes disk io to a set speed limit. Ideally the program would work similar to this: $ limitio --pid 32423 --write-limit 1M Limiting process 32423 to 1 megabyte ...
30
votes
4answers
15k views

What happens if you edit a script during execution?

I have a general question, which might be a result of misunderstanding of how processes are handled in Linux. For my purposes I am going to define a 'script' as a snippet of bash code saved to a text ...
29
votes
4answers
3k views

python vs bc in evaluating 6^6^6

I am evaluating the expression 6^6^6 using python and bc separately. The content of the python file is print 6**6**6. When I execute time python test.py, I get the output as real 0m0.067s ...
28
votes
7answers
10k views

Get chrome's total memory usage

Since google chrome/chromium spawn multiple processes it's harder to see how much total memory these processes use in total. Is there an easy way to see how much total memory a series of connected ...
27
votes
2answers
57k views

How can I kill a <defunct> process whose parent is init?

Transmission is intermittently hanging on my NAS. If I send SIGTERM, it doesn't disappear from the process list and a <defunct> label appears next to it. If I send a SIGKILL, it still doesn't ...
27
votes
2answers
1k views

Can a zombie have orphans? Will the orphan children be disturbed by reaping the zombie?

As I understand it, a zombie process has died but still exists as a placeholder in the process table until its parent (or init if the zombie is itself an orphan) checks its exit status. And my ...
24
votes
1answer
9k views

How to ensure exclusive CPU availability for a running process?

At first, the question seems to be a little bit silly/confusing as the OS does the job of managing process execution. However, I want to measure how much some processes are CPU/IO-bound and I feel ...
23
votes
9answers
42k views

Ensure a process is always running

I started hosting sites a while back using Cherokee. For external sources (FastCGI, etc) it has an option to launch the process if it can't find one running on the designated socket or port. This is ...
21
votes
3answers
202k views

How can I see what processes are running?

I use Ubuntu Server 10.10 and I would like to see what processes are running. I know that PostgreSQL is running on my machine but I can not see it with the top or ps commands, so I assume that they ...
20
votes
4answers
51k views

How to kill multiple processes

to find the PID of the process to kill use : pgrep <process command> I then use the kill command to kill the PID returned by pgrep <process command> kill <PID> Can these ...
19
votes
6answers
20k views

How to make a process invisible to other users?

How could you launch a process and make it invisible to the top command? The process is started by a normal user (not root), and should not be visible to other normal users.
18
votes
2answers
4k views

What does a niceness value of (-) mean?

According to the man page, and wikipedia; nice ranges from -20 to 20. Yet when I run the following command, I find some processes have a non numerical value such as (-). See the sixth column from ...
18
votes
2answers
10k views

Per process firewall?

I've been reading around but can't seem to find a way to create per-process firewall rules. I know about iptables --uid-owner but that only works for outgoing traffic. I've considered scripting ...
17
votes
5answers
45k views

What is the difference between ps and top command?

What is the difference between ps and top command ? I see that both can display information about running processes . Which one should be used when ?
17
votes
2answers
964 views

How are the processes in UNIX numbered?

I can't find any pattern when I look at the numbering of PIDs in process table (ps -a), as the PIDs are not subsequent numbers and sometimes there are large "gaps" between those numbers. Is it ...
16
votes
2answers
6k views

How should I check whether a given PID is running?

I'm writing a Perl script that parses logfiles to collect PIDs and then checks whether that PID is running. I am trying to think of the best way to make that check. Obviously, I could do something ...
16
votes
2answers
20k views

Kill a suspended process?

I was slightly confused by: % vim tmp zsh: suspended vim tmp % kill %1 % jobs [1] + suspended vim tmp % kill -SIGINT %1 % jobs [1] + suspended vim tmp % kill -INT %1 % jobs [1] + suspended ...
15
votes
1answer
12k views

What does <defunct> mean in the output of ps?

I had issued the ps -ef|grep java command and this is one of the entries that I got : subhrcho 875 803 0 Jan23 pts/5 00:02:27 [java] <defunct> What is <defunct> implying here ? ...
14
votes
7answers
51k views

What is a command to find priority of process in Linux?

How can i view the priority of a specific process ?
14
votes
4answers
17k views

Ctrl-C with two simultaneous commands in bash

I want to run two commands simultaneously in bash on a Linux machine. Therefore in my ./execute.sh bash script I put: command 1 & command 2 echo "done" However when I want to stop the bash ...
14
votes
3answers
12k views

Systemd and process spawning

Don't normally post here but I am ripping my hair out over this one. I have a Python script that forks when it launches, and is responsible for starting a bunch of other processes. This script used ...
13
votes
2answers
10k views

Is SIGQUIT the same as SIGTERM?

I'm learning CentOS/RHEL and currently doing some stuff about process management. The RHCSA book I'm reading describes running kill 1234 as sending SIGQUIT. I always thought the kill command without ...
13
votes
3answers
7k views

Simulate an unkillable process in D state

For catastrophe testing scenarios on out server environment we're looking for an easy way to make a process stuck in D (uninterruptible sleep) state. Any easy ways? An example C sample code would be ...
12
votes
1answer
891 views

What is a practical example of using the suspend command in Bash?

suspend is a builtin command in Bash. When would you naturally use this command and find it useful?
11
votes
3answers
11k views

Why do top and ps show different PIDs for the same processes?

When I run top -H, I see that my multiple mysql threads all have the same PID. However, in ps -eLf I see each one has a different PID: ps -eLf UID PID PPID LWP C NLWP STIME TTY ...
11
votes
2answers
12k views

How to check, which limit was exceeded? (Process terminated because of ulimit. )

Let's assume process runs in ulimited environment : ( ulimit ... -v ... -t ... -x 0 ... ./program ) Program is terminated. There might be many reasons : memory/time/file limit exceeded ; just ...
9
votes
2answers
27k views

Run commands in parallel and wait for one group of commands to finish before starting the next

I have script including multiple commands. How can I group commands to run together ( I want to make several groups of commands. Within each group, the commands should run in parallel (at the same ...
9
votes
3answers
12k views

How can I kill a job that was initiated in another shell (terminal window or tab)?

If I begin a process and background it in a terminal window (say ping google.com &), I can kill it using kill %1 (assuming it is job 1). However if I open another terminal window (or tab) the ...
9
votes
4answers
7k views

Simple queuing system?

Given a commodity PC, we would like to use it to execute some tasks in the background round the clock. Basically, we would like to have commands like: add-task *insert command here* list-tasks ...
8
votes
3answers
531 views

Command with which a process was run

Suppose I ran the process with the following command: myapp -e -c -f myapp.config > /var/log/myapp/myapp.log 2>&1 After a while I only have pid of myapp process, e.g. 1234. Is there a way ...
8
votes
5answers
13k views

'kill java' doesn't kill java

I am running debian right now and sometimes I need to kill java manually from the terminal, but when I try kill #pid# or pkill java nothing happens. No console output (ok, that's normal) and java is ...
8
votes
1answer
3k views

Why can't we kill uninterruptible D state process?

I have often issues with processes stuck in D state, due to NFS shares behind firewalls. If I lose connections, processes get stuck in D state and I can't kill them. The only solution becomes hard ...
8
votes
3answers
6k views

How can I check to see if a process is stopped from the command-line?

I have the pid and I just stopped a program using kill -stop PID Now I want to continue it by doing kill -cont PID But only if it's already stopped. How would I check to see if it's stopped or ...
7
votes
3answers
1k views

Undo bg; Undo putting a process into the background?

I've started a long running and machine hog process. I've hit CTRL-Z to stop it. I've then put it in the background with bg. Oops, I should have restarted with fg so that I could easily stop and start ...
7
votes
3answers
6k views

Why is there no easy way to list all processes in a given process group?

Clearly, in order to support kill(0) efficiently, the kernel must keep track of the processes in a process group. But that information is not exposed at all, in any way to the user space. To get that ...
7
votes
2answers
367 views

How is a graphical application started from a bash session connected to that bash session?

When I start a graphical application from a terminal running bash, that application is somehow connected to that bash session. For example, when the applications dumps some text it will appear in the ...
7
votes
1answer
2k views

Difference between closing the terminal using the closing button, and Ctrl-D

When I'm launching a background process and then closes the terminal using the window's closing button, the background process gets killed. However if I close the terminal using Ctrl+D, the background ...
7
votes
2answers
5k views

kill -9 hangs, unable to kill process (murder proof process) [duplicate]

Possible Duplicate: What if ‘kill -9’ does not work? I guess its a bit late to ask this, but for future reference; I was called to look at a server today after a customer was reporting that ...
6
votes
3answers
5k views

What happens to suspended jobs in unix?

We can issue CTRL+Z to suspend any jobs in Unix and then later on bring them back to life using fg or bg. I want to understand what happens to those jobs that are suspended like this ? Are they ...
6
votes
4answers
1k views

Best practices for job/process tracking and multi-tasking

I run 10+ different commands from 10+ different directories, and I need a better process to track everything. I do a lot of debugging, and often times I need to work on multiple issues in parallel. I ...
6
votes
4answers
1k views

Is there a utility for daemonizing processes as non-privileged user?

A thing I frequently want to do is launch some long running process or server as my own non-privileged user and then have a way to tell if it's still running and restart it if not. So for example I ...