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

learn more… | top users | synonyms

4
votes
2answers
809 views

What is “automatic stack expansion”?

getrlimit(2) has the following definition in the man pages: RLIMIT_AS The maximum size of the process's virtual memory (address space) in bytes. This limit affects calls to brk(2), mmap(2) and ...
4
votes
2answers
536 views

Why is `sudo pkill -HUP -f “nginx: master process”` returning code 129 and no output

I'm trying to trigger a reload of the Nginx master process by using pkill and sudo. The server reloads fine, but I was just curious if anyone knows why the command sudo pkill -HUP -f "nginx: master ...
4
votes
2answers
976 views

Linux running slow with 0 swap left

Our Linux server is responding very slowly. top doesn't show any excessive CPU usage. I noticed that even though there's about 5GB of free memory, the system is using all of swap with no free swap ...
4
votes
1answer
2k 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 ...
4
votes
1answer
1k views

Disable random memory address generation in my programs

I'm reading "The art of exploitation" and would like to try some experiments, including reading from and writing to various memory address. I've created some simple programs and trying to overwrite ...
4
votes
2answers
435 views

retrieving names of all open pdf files (in evince or otherwise)

I constantly have many PDF files open. These are usually downloaded using chrome and immediately opened using evince. I sometimes want to persist the state of all my open PDF files, so I could ...
4
votes
2answers
302 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?
4
votes
3answers
630 views

What is a process GID and what purpose does it serve?

Reading mod_wsgi's documentation I found you can choose which group to run the worker processes as. I can understand group ownership of files and how only a user who belongs to that group can achieve ...
4
votes
1answer
44 views

Suspend and edit previous single line commands

Say I want to modify the latter of some concatenated command line options, is it possible without killing the first command? Specifically I have compile and run scripts executed thusly: > compile ...
4
votes
1answer
2k 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 ...
4
votes
2answers
3k views

Bash script wait for processes and get return code

I am trying to create a script which will start many background command. For each background command I need to get the return code. I have been trying the following script : #!/bin/bash set -x ...
4
votes
1answer
1k views

Difference between poll_s and ep_poll WCHAN in ps output

When I issue ps -elf|grep python for example on my system, I see these: 1 S 1000 6020 6008 0 80 0 - 9914 poll_s Jul12 ? 00:00:01 python manage.py run_gunicorn -t 3600 -w 8 -b ...
4
votes
4answers
590 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
579 views

controlling a process from a different session

So, I ssh into my remote computer and launch a process... time passes... my ssh session breaks. I log in again, and of course, I don't have access to the original process now. I can see it still if I ...
4
votes
1answer
985 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 ...
4
votes
2answers
213 views

start process so that it can't spawn new ones

Is it possible to start new process so that it couldn't spawn new ones (untrusted code)? Also how do I start a process so it couldn't make any input/output to files and in general any devices?
4
votes
2answers
706 views

Process descendants

I'm trying to build a process container. The container will trigger other programs. For example - a bash script that launches running background tasks with '&' usage. The important feature I'm ...
4
votes
1answer
116 views

How to monitor all executions of an executable over a time period

I know how to monitor a process. Commands like top and so forth can monitor the CPU time and memory usage for a given process instance. But say I expect a given executable to be run several times in ...
4
votes
1answer
1k views

I don't want other users see my processes in ps aux. I have root. It's Debian. How to use grsec?

I installed 'linux-patch-grsecurity2' and it has some sort of interface. ~$ sudo gradm2 gradm 2.1.14 grsecurity administration program Usage: gradm [option] ... Examples: gradm -P ...
4
votes
1answer
362 views

Is it possible to send a keyboard event to a background script that's expecting user interaction? (Using 'read')

Ex: $read & [1] 15139 [1]+ Stopped $jobs -l [1]+ 15139 Stopped (tty input) read
4
votes
3answers
4k views

when does the system send a SIGTERM to a process?

My server program received a SIGTERM and stopped (with exit code 0). I am surprised by this, as I am pretty sure that there was plenty of memory for it. Under what conditions does linux (busybox) send ...
4
votes
1answer
129 views

Raise Brightness When Maximizing Terminal

I'm looking to raise the brightness when I maximize or foreground the Terminal window which has Vim running. I would like to reset the brightness to normal when I minimize or background that process ...
4
votes
2answers
163 views

How to kill a process giving it a number of seconds before a doing the forced kill?

I do have the PID of the process to be killed but I do want to give it the chance to die peacefully, without doing a -9. Expected behaviour: check if PID is still running for up to ten seconds and do ...
4
votes
2answers
3k views

Write inside a socket open by another process in Linux

Is it possible on Linux for a process to write inside a socket open by another one? Let's say I open a connection to google.com using netcat: myuser@linux:~$ nc google.com 80 Now I can lookup for ...
4
votes
2answers
2k views

Detailed Per-Process Profiling

I am looking for a way to profile a single process including time spent for CPU, I/O, memory usage over time and optionally system calls. I already know callgrind offering some basic profiling ...
4
votes
2answers
480 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 ...
3
votes
5answers
1k 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 ...
3
votes
2answers
2k views

Slow down a process without affecting other processes

I have a program. When it is running, the CPU temperature raise from 50 to 80 Celcius, which is my major concern. I can control the CPU frequency to slow it down, but other processes will be slowed ...
3
votes
3answers
237 views

Killing an instance of a process

This is an output from pstree In the picture you can see the marked boxes in which the processes are multiplied by a number? What is this number? I had a doubt that it is the number of instances ...
3
votes
2answers
212 views

$BASHPID And $$ differ in some cases

I'm reading "BASH pocket guide of Oreilly". It said: The process ID of the current Bash process. In some cases, this can differ from $$. Above explanation , explained $BASHPID variable. ...
3
votes
3answers
1k 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 ...
3
votes
3answers
159 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 ...
3
votes
2answers
2k views

How to check how long a process ran after it finished?

Currently I'm using the following to check how long a process is actually running: ps -eo uid,pid,etime | egrep '^ *MY_ID' | egrep 'PID_OF_PROCESS' And that outputs the following: MY_ID ...
3
votes
2answers
509 views

How do I execute a script later?

I need to compile gcc45 on my computer and that's a lengthy and resource-intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to: $ ...
3
votes
5answers
3k views

Drop Process Privileges

I have a process that gets started by a damon running as root, now I want to "downgrade" this process's privileges to those of your average user. Is this possible? If yes how? PS: Running unix on a ...
3
votes
3answers
2k views

Fix “firefox is already running” issue in Linux

I am trying to open Firefox in CentOS, but I'm getting the following message: Firefox is already running but is not responding and Firefox doesn't open. I tried this in command line: kill ...
3
votes
2answers
174 views

Is grandchild process also child process?

In Unix/Linux terminology, do child processes of a process include grandchild processes of the process?
3
votes
4answers
725 views

How to run java process to be seen not as 'java…' in processes list?

Is it possible to run a Java process in Linux in a way that it could be seen in ps as some sort of alias? It would be easier to restart it when it is down.
3
votes
2answers
344 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 ...
3
votes
1answer
167 views

init: is it a user thread or a kernel thread?

init is the first task executed after kernel is loaded, right? Then who is its owner. also I can see [swapper/0] [swapper/1] ..... [swapper/7] having pid 0 PID PPID CPU TASK ST %MEM ...
3
votes
3answers
177 views

“Virtual” shell, ie. jailing an user inside a process

The title might not say much about the issue at hand so let me get straight to the point. Let's assume I have a casual user who can log in to the system via SSH into a bash shell. I also have a PHP ...
3
votes
2answers
530 views

How to reload a background process?

I have a python script which I would like to run in the background. So I do this: $ nohup python script.py & If I am frequently making changes to the script, I need to terminate the process ...
3
votes
2answers
1k views

Do sleeping processes get the same CPU time?

Some processes spend most of their "lives" in a sleep status. Daemons, servers and general listener come to mind. I was wondering if they get the same CPU time in that state? On something like my ...
3
votes
4answers
6k views

What is a command line alternative to top for finding current CPU utilization that isn't dependent on screen width?

If I run top -p <myPID> -n 1 with a terminal that isn't wide enough, the CPU utilization % is omitted from the output. When trying to find a process' cpu utilization via bash scripting, this is ...
3
votes
2answers
728 views

Using top to see processes run by a user on behalf of sudo

If I run top -u username I will see all the processes by a particular user. Is there a way to also see all the processes that the user called via sudo?
3
votes
2answers
383 views

I need help with a cronjob to watch for runaway processes and kill them

I have an interesting situation, I have a runaway ruby process - I know exactly how I trigger it. Point is, it got me thinking about runaway processes (CPU usage or memory usage). How would one ...
3
votes
2answers
51 views

Process in user mode switch to kernel mode. Then the process will have root privileges?

According to http://www.linfo.org/kernel_mode.html in paragraph 7: When a user process runs a portion of the kernel code via a system call, the process temporarily becomes a kernel process and is ...
3
votes
5answers
319 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 ...
3
votes
3answers
59 views

Contents of stack area of a process

I've been going through some Unix text books and I can't have a clear picture on the contents of the stack area of the process. Can anyone please explain or point out some references?
3
votes
2answers
227 views

Where is the virtual memory stored on hard drive?

If a process wants to access a memory address that is not in physical memory, the OS outsources a page frame from physical memory to the hard drive for later use. Where on the hard drive is this data ...