A process is an instance of a computer program that is being executed.
1
vote
1answer
67 views
Command to list in real time all the actions of a process
I cannot remember this command (and googling was unsuccessful), but there is a way to get the list of actions performed by a process, that outputs something like
# listprocessactions -p 1234
...
8
votes
1answer
4k views
Getting information about a process' memory usage from /proc/pid/smaps
For a given process in /proc/<pid>/smaps, for a given mapping entry what are:
Shared_Clean
Shared_Dirty
Private_Clean
Private_Dirty
Is Shared_Clean + Shared_Dirty the amount of memory that ...
2
votes
5answers
869 views
Graceful way to kill process
After my bash script is done with the selenium server, the script kills it like this:
kill `ps -ef | grep selenium | awk '{ print $2 }'`
While this works and it does kill the selenium script, it ...
6
votes
1answer
861 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 ...
1
vote
1answer
763 views
How can I send data to the STDIN of a background process?
I'm trying to:
Launch several ssh sessions (processes) through a script (Python)
Communicate with the sessions by sending them commands via STDIN (even though they aren't open in my current ...
1
vote
1answer
931 views
Apache cannot fork: cannot allocate memory
I am running apache on Fedora with mod_perl. The server forks a process to send an email frequently - and the fork exits.
Suddenly, I got: Cannot fork: Cannot allocate memory. There was plenty of ...
1
vote
5answers
759 views
How to stop a program running as daemon
I have launched iperf in daemon mode with iperf -s -D and now I want to stop the service.
I tried to use sudo kill pid but it neither work nor complain. The daemon is still running when I check ...
8
votes
4answers
3k views
How to attach terminal to detached process?
I have detached a process from my terminal, like this:
$ process &
That terminal is now long closed, but process is still running and I want to send some commands to that process's stdin. Is ...
1
vote
1answer
270 views
Cross-platform (Linux, BSD, Solaris) way to check if pid exists
I am looking for a reliable cross-platform way to check if a process with a specific pid is running. Two possible solutions came up:
kill -0 $PID — exit status is 0 if it the process exists and 1 ...
4
votes
2answers
451 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 ...
4
votes
4answers
445 views
How does forking affect a process's memory layout?
Please see the following figure showing the memory layout of a process:
:
When someone forks(), and a new task_struct is assigned, what happens to the addresses of the process? In more or less other ...
4
votes
1answer
833 views
Why is my C++ program killed by OS
I've compiled small C++ application for school project on my virtual ubuntu 11.04. However when I attempt to run it over some larger data set after ~20 sec the program is killed by OS.
Killed ...
23
votes
2answers
2k 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 ...
5
votes
1answer
201 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 ...
10
votes
3answers
346 views
Maintain 100 instances of a program running
I'm currently using supervisord to maintain 100 instances of a script running at once. If any die then it starts up a new one.
However it seems to be struggling maintaining larger numbers (>300 ...
3
votes
3answers
152 views
Detecting whether a server is loaded
I have to start some performance test on a Rhel 6 box, but before starting the test, i have to make sure there are no other java processes running.
The manual way of doing it would be to use "ps -ef ...
1
vote
1answer
276 views
How can I manage jobs after I disconnect from my tty/ssh session?
If I ssh to a box and start a task that will take some time to complete I usually press control+z to pause the process, and then immediately type bg 1 to put run it in the background.
I can then type ...
5
votes
3answers
2k views
How to read environment variables of a process
Linux's /proc/<pid>/environ does not update (as I understand it, the file contain the initial environment of the process).
How can I read a process's current environment?
5
votes
3answers
673 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
...
19
votes
2answers
369 views
When you try to terminate a process for good, which option for “kill” should you use?
I am getting a lot of mixed messages from people, and was wondering if it there really is not much of a difference in what you use.
kill 'x'
killall 'x'
kill -9 'x'
These are some options I've been ...
4
votes
1answer
90 views
Is it the process that cleans itself on termination or the kernel?
Recently I found this in a powerpoint presentation:
When a program is compiled and linked, the linker inserts some extra code in the program. It is this code that calls the main function about the ...
2
votes
3answers
385 views
What is meant with terminating a process normally?
In an examination it is stated:
Give 2 different ways that a process can terminate normally. Describe
the differences.
What is meant with terminate normally?
5
votes
3answers
2k views
How to kill a daemon with its name gracefully?
I usually kill a process with killall.
killall markdoc
But I can't sure this command terminates the process gracefully.
Does this command graceful termination? If it's not, how can I kill a ...
0
votes
0answers
33 views
Is it possible that a method inside a module (in kernel mode) be preempted?
My basic question is about system stack of a thread, and system stack of a process
Two methods in a module?
Which of the methods can be preempted via kernel mode preemption,
the one in process ...
5
votes
2answers
692 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?
5
votes
1answer
206 views
Why is the following command killing a system?
Anyone understand the following code , running in bash ?
:(){ :|:& };:
It seems to be a "fork" bomb on Linux.
1
vote
1answer
107 views
Alert when a process exits
I often download files using wget and cURL.
Is there anyway I can make my Linux box give a visual alert when either of those processes exit (i.e: the download completes)
PS : I am using Ubuntu ...
2
votes
4answers
573 views
How to get a process uptime under different OS?
Under Linux I can get a process's uptime in seconds with:
echo $(($(cut -d "." -f1 /proc/uptime) - $(($(cut -d " " -f22 /proc/$PID/stat)/100))))
But how can I get it under different OS? ex.: ...
5
votes
4answers
1k 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 .
...
3
votes
1answer
522 views
Limit process resource consumption in CentOS 5 (2.6.18 kernel)
I would like to limit the resource (CPU, Memory, and network bandwidth) consumption of processes on the same server. And it will be good if I can migrate processes from one server to another.
I ...
3
votes
1answer
560 views
Will process ids be recycled? What if you reach the maximal id?
Process IDs are strictly increasing, but if your system runs long enough and there is a lot of processes terminating and starting, you could at some point reach the limit of the underlying integral ...
1
vote
3answers
2k views
Why is apache2 showing up a defunct in the process list?
When I run top I see one line that doesn't look too good:
2475 www-data 20 0 0 0 0 Z 1 0.0 0:00.19 apache2 <defunct>
Why is this process <defunct> and what should I ...
1
vote
2answers
302 views
Why does my one instance of VLC have many processes?
As you can see from the image below (htop), I have several vlc processes running, all with only the command vlc. However, I'm only running one vlc instance.
What are the other instances? Would it ...
2
votes
2answers
988 views
killing a process on a remote machine when the machine is stuck
I started a very resources-consuming process on a remote server via ssh. It is an optimization problem run in MATLAB. It takes full memory and CPU. In fact, I am not even able to ssh to the machine, ...
0
votes
1answer
263 views
Enter process running in background/bring to foreground [duplicate]
Possible Duplicate:
How can I disown it a running process and associate it to a new screen shell?
I started a java client using nohup to get it to run in the background (needed to log out ...
1
vote
0answers
141 views
Rogue Java process brings my computer to a halt
In reference to my earlier post: Is there a log of past threads that are now closed?
I gave the process a kill -STOP signal and started examining the details. I can't seem to figure out why it is ...
1
vote
2answers
209 views
Is there a log of past threads that are now closed?
Sometimes, I have a rogue Java process which takes up 100% of my CPU and makes it jump about 30C in temperature (usually resulting in a crash if not killed).
Problem is, I can never really identify ...
1
vote
3answers
109 views
What is the lowest level I can see my system running?
Let me try and clarify.
Is there any way for me to see very very low level activity on my computer? Stuff like:
register content
opcodes being sent
specific memory addresses
Or anything lower ...
5
votes
3answers
1k 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, ...
2
votes
2answers
223 views
add “check if fetchmail is running” to this script
while ! postqueue -p | grep -q empty; do
sleep 1
done
killall wvdial
this script checks if my mail queue is empty, then disconnects my modem. now i would like to add also a checking to fetchmail ...
4
votes
2answers
2k views
How to pkill by “command name”?
So I'm executing a command like:
COMMANDNAME -PARAMETERS
But..why can't I kill it with "pkill"? I'm trying with:
pkill -9 "COMMANDNAME -PARAMETERS"
but it doesn't kills the "COMMANDNAME ...
4
votes
3answers
325 views
What is a subshell (in the context of the documentation of make)?
I'm reading a book about the make command and there is a paragraph:
If any of the prerequisites has an associated rule, make attempts to
update those first. Next, the target file is considered. ...
3
votes
1answer
94 views
how to disallow user to change process group
Is it possible to restrict a process from changing it's process group? For example, user nobody seems to be able to call setpgid(0, 0) which sets process group of current process to pid of that ...
7
votes
3answers
572 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 ...
6
votes
1answer
2k 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 ...
3
votes
2answers
399 views
How is FireFox running on a virtual machine that has no display?
I am using a Red Hat virtual machine, accessible only remotely. However when I use the top command, one of the displayed processes taking up the most memory is firefox, located at ...
2
votes
1answer
213 views
There is no bash indicator prompt after a forked process terminates
I am reading the book Advanced Programming in the Unix Environment.
There is a test program to test the fork function. It works well in my Ubuntu. But what I confused is that why there is no command ...
6
votes
2answers
6k views
Limit process to one cpu core
How to limit process to one cpu core ?
Something similar to ulimit or cpulimit would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with ...
5
votes
4answers
967 views
Suspend/resume single process to/from disk
On occasion, we would like to suspend memory-intensive processes on our Ubuntu and OS X servers to temporarily free up some RAM for other jobs. If all we were worried about was CPU usage, a simple ...
2
votes
1answer
61 views
Start and stop multiple executable for easy debugging
I'm debugging a networking project, which involves interacting of 3 programs, ie a server, two different clients. However I find it difficult to start and stop them for debugging. Some methods I have ...