A process is an instance of a computer program that is being executed.

learn more… | top users | synonyms (1)

8
votes
2answers
270 views

How can I tell when a process has finished writing to a file?

I have a process which has been spawned from a shell. It is running as a background process and exporting a DB to a CSV file in /tmp. How can I tell when the background process has completed ...
8
votes
1answer
508 views

how to find out namespace of a particular process?

I already asked a question about how to list all namespaces in Linux, but there wasn't any correct and exact answers, so I want to find out a method which can help me to find out the namespace of PID ...
8
votes
2answers
313 views

How can I create a hard to kill process

I want to create a program that will be difficult to stop (even for the administrator) once it is started (with root privileges). Once started the process should continue to start itself at startup ...
8
votes
3answers
2k 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 ...
8
votes
1answer
11k views

Need explanation on Resident Set Size/Virtual Size

I found that pidstat would be a good tool to monitor processes. I want to calculate the average memory usage of a particular process. Here is an example output: 02:34:36 PM PID minflt/s ...
8
votes
3answers
3k views

Understanding top and load average

I'm observing a high load average on a certain machine (about 9) in all three load fields. I understand load as the number of processes in state "run" / currently desiring CPU time. Am I correct at ...
8
votes
1answer
270 views

Reliable way to jail child processes using `nsenter:`

I know that Linux namespaces, among many other things, can be leveraged to handle restricting and jailing child processes securely without any chance of their being zombied and dumped on init. But I'm ...
8
votes
3answers
1k views

Elegantly get list of descendant processes

I would like to get a list of all the processes that descend (e.g. children, grand-children, etc) from $pid. This is the simplest way I've come up with: pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ ...
8
votes
1answer
633 views

Negatives of running processes with real-time priority?

The question is as the title says, are there any downsides of running processes with real-time priority (chrt -f 99)? My hypothesis is that this combined with an affinity will ensure that any ...
7
votes
3answers
2k views

Use & (ampersand) in single line bash loop

I have been using this command successfully, which changes a variable in a config file then executes a Python script within a loop: for((i=114;i<=255;i+=1)); do echo $i > numbers.txt;python ...
7
votes
1answer
11k 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+'?
7
votes
1answer
557 views

Why does “kill -9 0” end my console session?

I just wonder why kill -9 0 ends my tty console session? What exactly is PID 0, it is not listed on a ps aux?
7
votes
3answers
4k views

nohup vs. Screen

In the past, I've used nohup to run big background jobs, but I've noticed that a lot of people use Screen in this context. Does Screen provide some kind of functional advantage that I am unaware of, ...
7
votes
2answers
2k views

How to stop xargs from badly merging output from multiple processes?

I'm using xargs with the option --max-args=0 (alternatively -P 0). However, the output of the processes is merged into the stdout stream without regard for proper line separation. So I'll often end ...
7
votes
3answers
414 views

Harddrive I/O per Pid

is there any way to see the disk I/O per pid/process ? Monitorix shows me the following and correct me if I´m wrong, but it looks like that the harddrive is slowing down the whole system: UPDATE #1 ...
7
votes
1answer
2k views

Nice and child processes

Can someone tell me what the relationship between a specified nice level and child processes ? for example, if I have a default nice of 0, and i start a script with nice 5, which in turn starts some ...
7
votes
3answers
3k views

If I see a process running using ps, how can I find the executable?

If I can see a process running using ps -e, how can I find the file which launched it?
7
votes
2answers
9k views

Launch process as another user/group (in init.d script)

I am editing a init.d script. The init.d script runs a utility script which then runs an process. From either bash scripts how would I make it launch the main process as a specific user and group?
7
votes
2answers
637 views

Finding out with which parameters a program was started

Is there a way to find out for any given process with which parameters it was started?
7
votes
3answers
309 views

Why is I/O uninterruptible?

What is the rationale behind making I/O uninterruptible? What would be the negative consequences if a process handling I/O were allowed to handle a signal?
7
votes
3answers
10k views

How to kill a daemon with its name gracefully?

I usually kill a process with killall. killall markdoc But I am not sure if this command terminates the process gracefully. Does this command achieve graceful termination? If it does not, how can ...
7
votes
3answers
1k views

How to stop a bunch of processes on unix fast?

How to stop a bunch of processes on unix fast. I can use ps/top, kill. If the number of processes is very large, I use shell script. Are there other ways, only one or two unix commands can do it ...
7
votes
2answers
304 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 ...
7
votes
2answers
555 views

How to find tty from which a particular cmd “scp” is executed

How can I find out who executed a particular command and which terminal was used to run it? Original: how can i know particular cmd is executed by whom and to know about my terminal
7
votes
2answers
3k views

How to kill both process and subprocess?

I asked a question to know how to get multiple lines of message from Python's subprocess module. The problem is that in the course of testing, I had to kill the python process that runs gnuchess ...
7
votes
1answer
476 views

Real time priorities in non real time OS

If I do the following command on my standard Linux Mint installation: comp ~ $ ps -eo rtprio,nice,cmd RTPRIO NI CMD ... 99 - [migration/0] 99 - [watchdog/0] 99 - [migration/1] - 0 ...
7
votes
2answers
4k 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 ...
7
votes
1answer
2k views

Is the sum of all PIDs “utime” the total system utime?

In order to measure a user's total CPU time, I'm using the "utime" field out of /proc/[pid]/stat: utime %lu Amount of time that this process has been scheduled in user mode, measured in ...
7
votes
2answers
2k views

How can you determine which process scheduler is being used? [duplicate]

I.e. is it the O(1) scheduler, the CFS scheduler, or an older one?
7
votes
1answer
263 views

What should interactive shells do in orphaned process groups?

(Re-posting in unix per the suggestion in http://stackoverflow.com/questions/13718394/what-should-interactive-shells-do-in-orphaned-process-groups) The short question is, what should a shell do if it ...
7
votes
2answers
506 views

Kill user processess on logout

I have a Ubuntu server that handles remote X sessions from users. However, I don't want to allow users to run any kind of background processes - so here is my question: How do I prevent users from ...
6
votes
3answers
676 views

Running continuous jobs remotely

I'm new to Linux, and I'm probably asking a fairly basic question. How do I run a continuous program on Linux? Basically, I have a program that will continuously check for content on a website. This ...
6
votes
5answers
5k views

Kill all descendant processes [duplicate]

I'm writing an application. It has the ability to spawn various external processes. When the application closes, I want any processes it has spawned to be killed. Sounds easy enough, right? Look up ...
6
votes
3answers
340 views

Understanding environmental variables in different contexts

Trying to understand the behaviour of the environment in Linux (Ubuntu 13.04 concretely), I've find different situations where setting envirionment variables are used or defined for/in different ...
6
votes
4answers
4k views

Finding the ID of a process and killing it

When ever I need to kill a background process I do ps -e | grep <process_name> Which prints something like this 1766 ? 00:00:13 conky , Then I use the process ID to kill it like so kill 1766 . ...
6
votes
2answers
738 views

Are kernel threads really kernel processes?

I've read in many places that Linux creates a kernel thread for each user thread in a Java VM. (I see the term "kernel thread" used in two different ways: a thread created to do core OS work and a ...
6
votes
3answers
3k views

killall gives me `no process found ` but ps

Could somebody explain to me the difference between kill and killall? Why doesn't killall see what ps shows? # ps aux |grep db2 root 1123 0.0 0.8 841300 33956 pts/1 Sl 11:48 0:00 ...
6
votes
1answer
275 views

Is there a way to see if process listening on TCP port receives a message?

According to tcpdump, my server receives the following TCP packet: 12:52:29.603233 00:19:e2:9e:df:f0 00:16:3e:6a:25:3f, ethertype IPv4 (0x0800), length 74: 10.10.10.65.38869 192.168.215.82.22: ...
6
votes
1answer
489 views

will the same pid be used after getting killed?

I had a file opened using vim editor. It was in a ssh session and since I had been idle for a long time, the session got closed and I had to establish the connection again. I opened the file again ...
6
votes
2answers
155 views

Why are there so few “running” processes?

On all of BSD/Linux/MacOS and Solaris, I made an observation - no matter how busy the system is, top always reports very few (usually 1-2) running processes. According to my limited understanding, a ...
6
votes
2answers
767 views

What does it mean each process has a current directory?

I'm reading "The Unix Programming Environment", but I don't comprehend the concept current directory of process. Each process, has a current directory, and all filenames are implicitly assumed ...
6
votes
4answers
2k views

How do I start a process with a nice value of -20 and not give it root privilege?

I would like to start a process with a nice value of -20. This requires me to use a command like - sudo nice -n -20 matlab. However, this starts matlab as root too. Is there a way to have matlab as ...
6
votes
2answers
198 views

How can I chase a program who is rising up my laptop's temperature?

After 40 days of non-upgrading I came back from a trip and I decided to dist-upgrade my Debian Sid box. Everything went fine but after rebooting I noticed that the temperature was 15°C over its ...
6
votes
1answer
4k views

Execute Nohup command with input

In UNIX, I have a process that I want to run using nohup. However this process will at some point wait at a prompt where I have to enter yes or no for it to continue. So far, in UNIX I have been doing ...
6
votes
2answers
647 views

Why Process/program becomes zombie?

If script is running fine from command line then, why the same script becomes zombie state after running through cron and How you will troubleshoot the same ? Here following real example : [root@abc ...
6
votes
1answer
158 views

What's the purpose of the /proc/pid/mountinfo file?

What's the purpose of the /proc/pid/mountinfo file (with pid being numerical process id)? As far as I can see it reflects contents of the /proc/mounts file but with added information. Also the file ...
6
votes
8answers
10k views

Bash way to check if a process is already running in the background (and skip re-execution based on that)?

Can I make a bash command line that only runs a certain command if the process is not already running (in the background)? How do I check*, if a command is already running? (so I can add the next ...
6
votes
3answers
724 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 ...
6
votes
2answers
803 views

Viewing foreground process using ps

I can see the background process using ps. But Is there a way to view the foreground process? For example, $nohup process1 & then ps -ef | grep "process1" would display the process ...
6
votes
1answer
1k views

All about ssh ProxyCommand

I am looking for an in-depth explanation of the following ProxyCommand, down to the nuts and bolts of its operation, please. Can you kindly completely dissect it for me and improve on it if you can? ...