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

learn more… | top users | synonyms (1)

5
votes
4answers
14k views

How do I know what service is running on a particular port in linux?

I am trying to run weblogic server on my linux machine and I am getting the following error : ERROR: transport error 202: bind failed: Address already in use ERROR: JDWP Transport dt_socket failed to ...
5
votes
1answer
277 views

Return value of a process and comparison of the number

I have a val.py python script that returns a negative number. import sys sys.exit(-1234) When I run this bash script, I get the value $? as return value of 46 (not -1234). Even when I tried to ...
5
votes
2answers
326 views

Portability of file descriptor links

I've always wondered this but never took the time to find out, so I'll do so now - how portable is the usage shown here of either /proc/$$/fd/$N or /dev/fd/$N? I understand POSIX guarantees /dev/null, ...
5
votes
2answers
704 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 ...
5
votes
3answers
628 views

Is it possible to support multiple processes without support for Virtual memory?

Is it possible to support multiple processes without support for virtual memory? I would like to know more about it if so.
5
votes
2answers
223 views

Processes in Linux

As I understand it, process descriptors are stored in a doubly linked list data structure. But a fork can create multiple children for the same process, so that makes me think that there is a tree ...
5
votes
2answers
8k views

How to list processes locking file?

Using flock, several processes can have a shared lock at the same time, or be waiting to acquire a write lock. How do I get a list of these processes? That is, for a given file X, ideally to find the ...
5
votes
3answers
30k 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 ...
5
votes
1answer
454 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 ...
5
votes
2answers
329 views

How can I allow a user to prioritize a process to negative niceness?

I want a user to run a specific process on the system with a negative nice value. I can't simply fork the process to background as this specific program is a minecraft server and I rely on the command ...
5
votes
1answer
2k 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 ? ...
5
votes
1answer
336 views

root owned program with setuid bit on

Ping is a a program owned by root with the user id bit set. $ ls -l `which ping` -rwsr-xr-x 1 root root 35752 Nov 4 2011 /bin/ping As I understand it, if a user runs the ping process, then the ...
5
votes
1answer
1k views

The meaning of output of pmap

I wrote main.c in Linux: int main() { while (1){} } When I compile and start it, I can pmap it: # pmap 28578 28578: ./a.out 0000000000400000 4K r-x-- /root/a.out 0000000000600000 4K ...
5
votes
2answers
521 views

Does linux kill heavy and long running background processes after they reach some threshold?

If I start a really heavy (memory/cpu intensive) running really long running process will the OS terminate it after a period of time arbitrarily? I.e. are there any limits beyond which the OS would ...
5
votes
3answers
545 views

Can I pipe any two processes to each other?

In this page from The Design and Implementation of the 4.4BSD Operating System, it is said that: A major difference between pipes and sockets is that pipes require a common parent process to set ...
5
votes
3answers
277 views

How can you change the process name of Wing IDE from python to something more descriptive

In my process list under Ubuntu (using top/System Monitor) one of the largest memory hogs (200+Mb) was python. I searched a bit for one of my programs to be the cause until I realised this was my ...
5
votes
3answers
1k views

How to poll existence of a background script correctly

I have a problem with the following kind of script: #!/bin/sh long_running_script.sh & while [ `pidof long_running_script.sh` ] do echo "." sleep 1 done The sript will ...
5
votes
2answers
2k views

Preventing program from using internet

Is there a way to block certain programs from being able to connect to the internet in Debian (a firewall blocking outgoing connections), so for example, to block a windows program running in wine ...
5
votes
2answers
2k views

How do I tell a script to wait for a process to start accepting requests on a port?

I need a command that will wait for a process to start accepting requests on a specific port. Is there something in linux that does that? while (checkAlive -host localhost -port 13000 == false) ...
5
votes
2answers
471 views

Obtaining PID of command earlier in Pipeline

I'm writing a bash script to use inotifywait to monitor a directory and kick off actions when changes are detected. Something like: inotifywait -m ... | while read f; do something; done Since ...
5
votes
3answers
404 views

Using `kill -s 0 $pid` vs `[[ -e /proc/$pid ]]` to detect if PID is running

One of the idioms often used to check if process is running is to use kill -s 0 $pid. My question is, does it have any upsides over using [[ -e /proc/$pid ]] construct? The script I'm writing is ...
5
votes
4answers
184 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 ...
5
votes
3answers
308 views

Dynamic file content generation: Satisfying a 'file open' by a 'process execution'

I have a read-only file, F. A program, P, that I'm not the author of, needs to read F. I want the content of F to come from another 'generator' program, G, whenever P tries to read F (taking F to ...
5
votes
1answer
2k views

Find processes using a network interface

I'm trying to find a way to safely shutdown a network interface, i.e. without disturbing any processes. For this I need to find out what processes are currently using that interface. Tools like ss, ...
5
votes
3answers
1k views

killing processes automatically

I need to kill all processs in a certain shell excluding certain processes. Like sh which is my shell. And the comand. This is what currently in my shell right now. rcihp146 :/home/msingh2> ps ...
5
votes
1answer
80 views

Why does `bash -c somecommand` sometimes not leave a bash process?

On an Ubuntu 12.04, with GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu), I tried the following command: $ bash -c 'pstree -s $$' init───sshd───sshd───sshd───bash───pstree $ bash -c 'pstree ...
5
votes
2answers
195 views

Why do forked processes sometimes appear with brackets [] around their name in ps? [duplicate]

On a Linux system a C process is started on boot, which creates a fork of itself. It is not a kernal process or something. In most cases a ps -ef show both processes as expecxted, but sometimes it ...
5
votes
2answers
600 views

Get the PID of file creation

I am writing a bash script that creates 5 files with the extension ".P" and write a line of "something" into them. "P" represents a number and it's the PID of the process that creates the file. How ...
5
votes
2answers
208 views

Is there a way to really prioritize processes or make Linux respect their priorities?

I know there are process priorities like in other operating systems, going from -20 (most prio) to 19 (less prio) but Linux seems to ignore them. Right now I was building the kernel in the background ...
5
votes
5answers
404 views

Is a persistent zombie process sign of a bug?

(OS: Debian variant.) Having a process with zombie-status. The PPid belonged to a gvim process. The contents of /proc/[pid]/wchan is do_exit, /comm is sh and /cmdline is empty, /status is shown ...
5
votes
3answers
2k views

How to track the number of processes and forks per user?

I need to figure out how many forks are done and how many concurrent processes are run by each user over time. It does not look like this information is tracked by my distribution. I know how to ...
5
votes
1answer
3k views

Stuck process: is it a bad sign?

Sometimes a few process are in a stuck state. For example: PID COMMAND %CPU TIME #TH #WQ #POR #MREGS RPRVT RSHRD RSIZE VPRVT VSIZE PGRP PPID STATE 99357 plugin-container ...
5
votes
1answer
667 views

Launch independent process [duplicate]

Possible Duplicate: How can I close a terminal without killing the command running in it? If I open a terminal emulator, type firefox & and then close the terminal, the process it ...
5
votes
2answers
1k views

Number of running processes show in top

The usual maximum number that I have seen in the "running" field displayed in top(1) is the number of logical CPUs installed in the system. However, I have observed that under Ubuntu 10.04 (not ...
5
votes
2answers
286 views

Processes do not respond to my signals

I have a strange behavior on my system. When I invoke a command in the shell (bash version 4.2.45(1)-release), say top or cat, the running program (the process) does not respond to Ctrl+C. I even ...
5
votes
2answers
1k views

Dump process core without killing the process

Is there a way to get a core dump (or something similar) for a process without actually killing the processes? I have a multithreaded python process running on an embedded system. And I want to be ...
5
votes
2answers
567 views

Turning off swapping for only one process with cgroups?

I would like to turn off swapping for only one process. Swap should work as usual for the other processes. How I can implement this with cgroups?
5
votes
1answer
3k views

Elegantly get list of children processes

I would like to get a list of all the processes whose parent is $pid. This is the simplest way I've come up with: pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g" Is there any ...
5
votes
1answer
166 views

Can I add to my groups in the current (shell) process? [duplicate]

If I add myself to a group, it applies only to newly launched processes. Actually it's more restricted than that; it seems to apply only to new logins. I'm not sure what the exact mechanism is, but ...
5
votes
1answer
1k views

Getting disk i/o statistics for single process in Linux

I need to monitor the I/O statistics of a process that writes to disk. The purpose is to avoid write rates too high for long periods. I know there's iostat tool to accomplish this task on a ...
5
votes
2answers
49 views

How can I see i/o stats for a briefly running process?

For long running processes like init, I can do things like $ cat /proc/[pid]/io What can I do if I want to see stats for a briefly running process such as a command line utility like ls? I don't ...
5
votes
3answers
1k views

Silently start task in background

I know that you can use this to start a process in the background, without getting the notification when the process is put in the background and when it is done like so: (command &) &> /dev/null ...
5
votes
2answers
446 views

Set process exclusivity in Linux

I am trying to measure the performance of a process. I have widely ranging performance measurements on small bit of single-threaded deterministic code that should perform the same every time. I would ...
5
votes
1answer
269 views

Unkillable apache2 processes

After upgrading from debian lenny to squeeze (apache2 2.2.16-6+squeeze4 and php 5.3.10-1~dotdeb.1), my apache processes started to exit with segmentation fault. It happens every 5-30 minutes (for 1 ...
5
votes
1answer
512 views

How can I search/browse in some process's memory?

I'm using MacOS X 10.7 and I'm not very familiar with unix. Is there a command for a search in some process's memory for a string?
5
votes
1answer
1k views

File descriptor limits are lost after a system reboot

I'm trying to increase the default file descriptor limits for processes on my system. Specifically I'm trying to get the limits to apply to the Condor daemon and its sub-processes when the machine ...
5
votes
1answer
180 views

How to monitor top applications using CPU (and IO if possible) in a graph?

I need to find what and when these applications used so much CPU (and IO if possible too). This should be in a graphic timeline like we see in GNOME System Monitor CPU History. I also want to compare ...
5
votes
2answers
461 views

Suggestions needed to debug why ps -ef gets stuck

A few of my processes consume 100% cpu. I'm trying to figure out which scripts are causing it I tried running strace ps -ef: open("/proc/PID/status", O_RDONLY) = 6 read(6, "Name:\textract\nState:\tR ...
5
votes
2answers
2k views

Hide processes from other users based on groups (under Linux)?

Is it possible to configure process hiding for certain user groups under a linux system? For example: Users from group X should not see processes owned by users from group Y in ps/top or under /proc. ...
5
votes
2answers
637 views

What is the need of the struct thread_info in locating struct task_struct?

While reading through the Linux Device Drivers, I could understand that the Process Descriptor (of type struct task_struct) has all the info regarding a particular task. The process descriptors are ...