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

learn more… | top users | synonyms (1)

2
votes
1answer
137 views

Which system calls could create a new process?

When executing ps command in my Linux system i see some user processes twice (different PID...). I wonder if they are new processes or threads of the same process. I know some functions in standard C ...
5
votes
3answers
386 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
2answers
563 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 ...
2
votes
1answer
332 views

Difference between process in background and daemon [duplicate]

What is technically the difference of a process that started in foreground and was manually put into background and a daemon? Do they have different properties?
3
votes
1answer
75 views

What is the rtsbpp-polling process doing?

In Ubuntu 12.04 LTS when I run the top command I see a process called rtsbpp-polling. Googling it gives only just a few hits to the Gentoo Linux forum that does not seem to be relevant (they don't ...
21
votes
3answers
960 views

If computers start counting at 0, why does the init process have a pid of 1?

Not much to put here in the body, the question is self explanatory.
1
vote
0answers
77 views

How to send a running process to jail?

"Go directly to jail; do not pass go, do not collect $200" — Monopoly Is there any way to make a running process's all future file access behave as if it has always been in a chroot environment?
1
vote
1answer
173 views

Grep Wvdial output while it is running

I want to grep the output from wvdial while wvdial is running. Actually I want to fire a task when the modem is connected. I want to do this in the following way: grep string "IP address", if it is ...
1
vote
2answers
58 views

What information about a process is retrievable after it is terminated? [duplicate]

After a process has been terminated, is it possible to retrieve any information about it, such as when it started and finished, &c. Is it possible to enable logging of this information?
69
votes
4answers
1k views

Can I somehow add a “&& prog2” to an already running prog1?

Most shells provide functions like && and ; to chain the execution of commands in certain ways. But what if a command is already running, can I still somehow add another command to be executed ...
1
vote
2answers
174 views

Is it possible to control xterm (or specifically a process that xterm has started) from another process?

If I start a process with xterm like this (where omxplayer is the process xterm is starting): xterm -fullscreen -fg black -bg black -e omxplayer -o hdmi -r %f Is it possible for me to write to ...
2
votes
2answers
304 views

AIX open() : file descriptor is zero (!?)

A daemon process, on detecting the presence of a text file in a particular directory then launches an executable file which opens the aforementioned text file in order to read and then transmit its ...
1
vote
1answer
171 views

How do I print the process name next to the process ID number in a file?

I'm redirecting results for something into a file and I also need to find the process name and ID number and redirect it to the file as well. I'm guessing the process name is the command in which I'm ...
1
vote
1answer
1k views

Modify 'Soft Limit' of 'Max processes'

I tried ulimit -u 2000 and ulimit -Su 2000 to modify the 'Max processes', and started up my program, but failed. I found file '/proc/pid/limit' is still: Max processes 1024 ...
2
votes
1answer
223 views

accessing stdin/stdout of a process started in another tty

I logged in to my linux physically(say tty1) and started a process that watches stdin for commands and has some stdout-put. How can I access/use this process from a SSH session?
4
votes
2answers
1k views

How to identify a process which has no pid?

I have a process which listen to 2 ports : 45136/tcp and 37208/udp (actually I assume it is the same process). But netstat doesn't return any pid : netstat -antlp | grep 45136 tcp 0 0 ...
2
votes
2answers
88 views

Detecting kernel thread on pre-3.0 kernels

Looking at the proc man page (http://man7.org/linux/man-pages/man5/proc.5.html) it is possible to detect which processes are kernel threads in /proc/<pid>/stat by looking at the flags value ...
2
votes
2answers
234 views

lsof - debug the output information

I was going through the questions of this site. In this particular question, I see the command lsof being used to list the files that are open for a particular user. I ran the below command in my ...
3
votes
1answer
315 views

Bind9 — How to find which programs are making which dns lookups?

Using bind9 on a laptop shows lots of nonsense domains when network connectivity is down: Oct 18 19:56:18 lap3 named[1536]: error (network unreachable) resolving './NS/IN': 128.63.2.53#53 Oct 18 ...
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
205 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 ...
2
votes
2answers
191 views

How to make processes not die after its parent dies?

I've been messing with forkbombs and noticed that if I just fork() processes repeatedly, killing the initial process will bring down the whole tree. This is not the case for forkbombs written in BASH ...
1
vote
3answers
3k views

process id and killing process - ps commmand

Please see the output of below ps command: abc@smaug:~/Desktop$ ps ax | grep firefox 2213 ? Sl 2:01 /usr/lib/firefox/firefox 2644 pts/0 S+ 0:00 grep --color=auto firefox Please ...
16
votes
3answers
3k views

Find out current working directory of a running process?

What command(s) can one use to find out the current working directory (CWD) of a running process? These would be commands you could use externally from the process.
2
votes
2answers
150 views

How does a process handle the situation when it finds no memory to use?

What happens when a particular process finds that there is no memory to use? Will that process kill/restart another process to proceed their task ? Or what the process (that requires more memory) ...
1
vote
1answer
68 views

devilspie detect if application was started with a flag

How can I set devilspie to detect if an application was started with the flag --hello-world from terminal? For example window_name detects the window title. How can transform in devilspie the ...
1
vote
3answers
89 views

ssh targetHost &; fg - does not work, but why?

I was trying the following combination in order to get the pid of the ssh session (running in the background displays the pid) and than fg to get back to the ssh session and introduce the password: ...
1
vote
2answers
139 views

KDE becomes slow

I experience problems with KDE 4.11.1 on Arch Linux. It suddenly becomes laggy and unresponsive and just as suddenly returns to the normal state after some time. Normal CPU load (KSysGuard): ...
2
votes
1answer
813 views

child process does not inherit the pending signals from the parent after a fork system call, why?

Could anybody please tell me the reason to why pending signals are not inherited by the child process? On the other hand, the child process inherits the signal handlers and signal mask from the ...
5
votes
1answer
176 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 ...
1
vote
4answers
740 views

monitoring file changes + process access to files

I would like to see what's happening in my app server folders, which files are changed by process x or which *.war files has been changed (replaced/created) in last x minutes. I am software developer ...
5
votes
3answers
1k 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 ...
8
votes
3answers
1k 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 ...
3
votes
1answer
88 views

How can I recover suspended processes after restarting X?

I had several instances of Firefox running, which I suspended. I think I used 'the GUI' (KDE's System Activity), which I think is the same as kill -19. Normally this works fine - I can resume the ...
0
votes
2answers
123 views

UNIX- Identify which processes are running more that 6hours

I need to know which processes are running more than 6 hours in UNIX. How can I find those out?
3
votes
1answer
3k views

bash: Run command in background and capture pid [duplicate]

Am writing a bash 4.1 script... Would like run another script (or internal function) in the background... And capture the pid of that background job in a variable in the foreground script... If the ...
1
vote
2answers
879 views

How can I automatically kill the process with the highest CPU load?

Sometimes programs will lock up in the background and cause high CPU usage. Is there any way I can programmatically ascertain which process is causing the highest CPU load at the moment and kill it?
3
votes
2answers
553 views

Wait for background processes to finish with inverse match process ID

I'm looking to run a number of background processes in a loop, but only want to wait for all of those processes to finish, still allowing another background process to continue. After doing some ...
2
votes
1answer
138 views

Why is a user started process running when not logged in?

Following a tutorial on setting up gnupg to manage ssh keys I've managed to get several instances of gpg-agent running: [root@frylock ~]# ps aux | grep agent root 2764 0.0 0.0 4208 432 ? ...
4
votes
2answers
186 views

LD_PRELOAD or similar to prevent network access

I'd like to start a program disconnected from the network (because immediately upon starting it tries to download huge amounts of data, which can be prevented by changing settings as soon as it ...
0
votes
2answers
246 views

Find PHP process that logs to file

I have started a PHP script via browser and due to a loop error the script continues to be executed even after closing the browser. I am noticing it since the script is logging error messages to my ...
1
vote
1answer
91 views

How to list killable tasks?

As manpage of ps states A process with STATUS with the value "D" means "uninterruptible sleep (usually IO)" Also, I've read: You should use TASK_INTERRUPTIBLE here, otherwise your kernel thread ...
2
votes
0answers
206 views

how to stop kernel threads preempting real time user space processes?

I created some processes in user space and tried to visualize its working in kernelshark with the trace recorded using trace-cmd. But kernel processes like the ones shown below are preempting my ...
2
votes
5answers
821 views

Get return value of process by PID

If I have the PID of a process that was killed, how might I get the return status of the process? I am particularly interested to know if the return status was 143 (kill) or 137 (kill -9) as I don't ...
3
votes
4answers
2k views

How to send keystrokes (F5) from terminal to a process?

I'm using an Raspberry Pi in combination with Chromium (kiosk mode) to show up some stats. The Pi doesn't have an connected keyboard so I searched for a solution to send keystrokes from the terminal ...
1
vote
1answer
176 views

Is there a way to see which process invoked a shell script?

Is there a possibility so see from some unix log file what process have invoked a bash/ksh shell script or is this shell script invoked manually from command line? So is there some log file which ...
3
votes
1answer
347 views

Linux: How to check whether a process is slowed down by other running processes

I have one process running on a RHEL 6.3 machine. Somehow this is taking a longer processing time than the same process running on another machine. How is it possible to know why this process is ...
2
votes
2answers
103 views

Absolute path to currently-running zsh?

Sometimes the output of ps -p $$ shows the absolute path to the currently-running zsh, % ps -p $$ PID TTY TIME CMD 1027 ttys005 0:00.11 /usr/local/bin/zsh but not always: % ps -p ...
3
votes
5answers
513 views

Is there a way to listen to process?

I want to know if there is a way to listen to a process in linux & unix - when it ends and what's the exit code of the process(script). I dont want to write a script that will run X seconds and ...
5
votes
2answers
509 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 ...