An instance of a running computer program.

learn more… | top users | synonyms

109
votes
9answers
52k views

Keeping a linux process running after I logout

I'm connecting to a Linux machine through SSH, and I'm trying to run a heavy bash script that makes filesystem operations. It's expected to keep running for hours, but I cannot leave the SSH session ...
80
votes
9answers
41k views

Environment variables of a running process on Unix?

This is to troubleshoot some problems related to environment variables .. On Windows, I could do this by using tool such as ProcessExplorer to select particular process and view values of each ...
36
votes
5answers
6k views

How to prevent “ps” reporting its own process?

$ ps | grep django 28006 ttys004 0:01.12 /usr/bin/python bin/django celeryd --beat 51393 ttys005 0:01.45 /usr/bin/python bin/django celeryd -l INFO 51472 ttys005 0:01.29 /usr/bin/python ...
27
votes
4answers
25k views

How to sort ps output by process start time?

Is there a way to sort ps output by process start time, so newest are either at the top or bottom ? On Linux ? On SysV5 ? On Mac ?
26
votes
5answers
3k views

What is svchost and why are multiple instances of it running?

There's six instances running on my desktop, and probably ten on a server I manage. What is this, and is it vital to system function?
24
votes
3answers
14k views

Show full process name in top

I'm running a rails stack on ubuntu. When I ps -AF, I get a descriptive process name set by the apache module like 00:00:43 Rails: /var/www... which is really helpful in diagnosing load issues. ...
20
votes
4answers
49k views

How do you free up a port being held open by dead process?

A colleague of mine recently ran into a problem where a process that had supposedly died was still bound to a network port, preventing other processes from binding to that port. Specifically, netstat ...
19
votes
5answers
25k views

how i can identify which process is making UDP traffic on linux?

my machine is continously making udp dns traffic request. what i need to know is the PID of the process generating this traffic. The normal way in TCP connection is to use netstat/lsof and get the ...
19
votes
6answers
17k views

If I launch a background process and then log out, will it continue to run?

Asking this after a prolonged discussion with a coworker, I'd really like a clarification here. I launch a background process, either by appending "&" to the command line or by stopping it with ...
16
votes
5answers
42k views

Dump a linux process's memory to file

Is it possible to dump the current memory allocated for a process (by PID) to a file? Or read it somehow?
16
votes
5answers
29k views

How to get pid of just started process

I want to start process (eg. myCommand) and get its pid (to allow to kill it later). I tried ps and filter by name, but I can not distinguish process by names myCommand ps ux | awk ...
16
votes
9answers
1k views

Documentation As-A-Manual vs. Documentation As-A-Checklist

I've had discussions in the past with other people in my department about documentation, specifically, level-of-detail and requirements. In their view, documentation is a simple checklist of Y things ...
14
votes
2answers
2k views

Linux/Debian - What does 'pee' in moreutils do?

I recently discovered the 'moreutils' package in Debian (and Ubuntu). It's a collection of convenient unix tools. One of the commands is 'pee'. The man page says: pee is like tee but for pipes. ...
13
votes
4answers
24k views

Is there an equivalent command for 'init.d/networking restart' in OS X

From time to time, I've encountered issues with OS X clients' network connections (Wired and Wireless, Leopard/Snow Leopard) where nothing will fix the issue, until you reboot. Is there a ...
13
votes
3answers
5k views

Do background processes get a SIGHUP when logging off?

This is a followup to this question. I've run some more tests; looks like it really doesn't matter if this is done at the physical console or via SSH, neither does this happen only with SCP; I also ...
12
votes
6answers
9k views

How do I log CPU usage per process?

I have a box on Linode that's going through weird behavior. Every now and then CPU and disk I/O will shoot to 100% and the server becomes unresponsive and has to be booted. I'd like to investigate ...
12
votes
5answers
11k views

Set max file limit on a running process

I have a long running process that is eventually going to hit the max open file limit. I know how to change that after it fails, but is there a way to change that for the running process, from the ...
12
votes
3answers
19k views

How to get - number of threads per process?

This is one Ubuntu 9.10 server. Also how to see memory usage per process? Thanks
11
votes
5answers
4k views

Linux - How do I see when a process started?

How can I see when a process started, assuming I know the pid. (On Linux)
11
votes
3answers
6k views

How do I start a process in suspended state under Linux?

Practically, I need a process which behaves, as if I had pressed Ctrl+Z just after it started. Hopefully, it is possible to do such thing using a shell script. (Also, knowing the resulting PID would ...
11
votes
2answers
4k views

Linux - Find out the current working directory of a process?

If i have a process PID X, how can I find out what directory it was running in? I can see with ps aux | grep X the full command line that it was invoked with. However in this case it's ./script.sh, ...
9
votes
1answer
6k views

Putting a process in the background without stopping it - (ctrl+z)?

If I start a process by typing it in normally at the command line, such as wget http://site.com/bigfile.zip and then decide I want to move that to the background, I know that I can use something ...
9
votes
5answers
3k views

Limiting network throughput of an already launched process ? (Linux/FreeBSD)

Is there any utility to limit the network throughput of a process after it has been launched? Simple example: you note that a user takes all your upload bandwidth using scp and you'd like to limit the ...
8
votes
5answers
2k views

Kill a process and force it to return 0 in Linux?

In the Linux environment, how can I send a kill signal to a process, while making sure that the exit code returned from that process is 0? Would I have to do some fancy GDB magic for this, or is there ...
8
votes
5answers
46k views

How to measure solaris process memory usage?

How to check how much memory a solaris process consumes? I'd like both total address space allocated and the amount that is resident in RAM. I tried summing pmap output with some awk script, but it ...
8
votes
5answers
5k views

Are .pid files reliable for determining whether a process is running?

Many programs such as sshd create .pid files in /var/run/ that contain their process ID. Are these files reliable for determining whether a process is running? My guess is that these files are ...
8
votes
4answers
26k views

How do you kill a process tree in linux? [closed]

Sometimes, sending a SIGTERM to a process will cause it to send SIGTERM to all its child processes. However, sometimes this doesn't work. Is there a command or a utility that will allow me to kill a ...
7
votes
5answers
3k views

Pain removing a perl rootkit

So, we host a geoservice webserver thing at the office. Someone apparently broke into this box (probably via ftp or ssh), and put some kind of irc-managed rootkit thing. Now I'm trying to clean the ...
7
votes
8answers
4k views

How to detect a hidden process in linux?

We have a box we suspect has been rooted at work. The question is how do we find it? I am no system administrator, but I was brought onto the team to resolve the situation and I am curious where ...
7
votes
6answers
1k views

What is the best way to identify unknown processes on windows?

How do you typically identify processes in windows' task manager when trouble shooting a problematic system? It's easy enough to get a list of tasks via the task manager but how do you determine ...
7
votes
3answers
2k views

Supervisor VS cronjob

Actually I'm using supervisor to monitor a process and restart it when it stops for some reason. The problem is that in case of a supervisor crash the process stops get monitored. So I thought to ...
7
votes
2answers
4k views

Upstart : start service after non-upstart process

On Ubuntu 10.04, I need to start my service with upstart, but only when mysql is up and running. The problem is that mysql itself is not handled by upstart, so I can't use the "start on" feature. ...
7
votes
1answer
1k views

Verify disown command

I issued the ^z; bg; disown sequence in order to allow me to close an ssh session in which I am running a super-important long-running process. This process writes status output to stderr, and it has ...
7
votes
7answers
20k views

How to kill a <defunct> process with parent 1

I am running Bacula on a RedHat box. From time to time, the storage daemon bacula-sd stops working and becomes <defunct>. [root@backup ~]# ps -ef | grep defunct | more root 4801 29261 0 ...
7
votes
3answers
4k views

How can I redirect an already running process's stdout/stderr?

(Running on an Ubuntu 10.04 64-bit server) Yesterday, I made the mistake of starting a process (which I didn't realize was going to take several days to run) over SSH without using screen. I've ...
7
votes
3answers
226 views

How to safeguard a shell script against running out of control?

I've recently had an experience of writing a shell script which crashed a server (and damaged a partition) by consuming all resources. It was hooked up to a cron job, and it seems it took longer to ...
7
votes
1answer
1k views

App Pool doesn't respect memory limits

I am dealing with a legacy .NET app that has a memory leak. In order to try and mitigate a run away memory situation, I've set the app pool memory limits from anywhere between 500KB to 500000KB ...
6
votes
5answers
3k views

Bash snippet for killing a process until it's dead?

I'm trying to write a robust bash script, and in it I create a background process. At the end of the script, I want to kill it. I have it's PID. I was thinking of somthing like this while [[ ps ef ...
6
votes
1answer
29k views

What is a Process Handle?

What is a process handle and what can we know about a running process through the "handle count" property in a task explorer?
6
votes
2answers
3k views

Determine process using a port, without sudo

I'd like to find out which process (in particular, the process id) is using a given port. The one catch is, I don't want to use sudo, nor am I logged in as root. The processes I want this to work for ...
6
votes
5answers
7k views

Find (and kill) old processes

Basically I need to be able scan the process tree and find processes that match a certain name and started running more than a week a go. Once I have them, I need to kill them. All the processes are ...
5
votes
3answers
9k views

Best way to kill Zombie and D state processes in linux

What is the best way to kill Zombie processes and D state process by single command.
5
votes
6answers
4k views

How to relaunch an executable if it dies

I'm looking for a way to monitor a process, and relaunch the executable if the process dies for whatever reason. Does Linux have a built-in tool that can do this?
5
votes
4answers
9k views

How do I automatically restart a process on server reboot/process exit?

On my Ubuntu server I use God to monitor some Ruby processes/scripts, including a Queue system. God automatically checks when one of my processes exists and restarts it. It also keeps track of memory ...
5
votes
4answers
8k views

Giving a process a specific name in GNU/Linux?

How do I launch a process so that it would have a specific identifier in ps command? UPD: I have a couple of servers running on one box. Most of them are in deployment mode. However one is in ...
5
votes
3answers
161 views

In server 2008 R2, if I run an app in administrator's mode, will child process still be in the same mode?

In server 2008 R2, if I run an app in administrator's mode, will the child process still be in the same mode? I raise this question because I suspect the child process from the app is not running in ...
5
votes
5answers
5k views

how to get process file name from PID in MacOS?

Is it possible to get a file name of a process using PID? ps displays a lot of useful information about a process, but not a hint about a process executable file location.
5
votes
2answers
2k views

Why are there so many processes running?

I host several Rails applications on a VPS using Ubuntu 8.04, Nginx, Passenger, Mysql, RVM, so all the usual suspects. In the last days it was the first time I really had to debug a problem and look ...
5
votes
5answers
3k views

What's the best way of setting up a cron job to check that a long-running process is still going and if not, start it?

As per the title: What's the best way of setting up a cron job to check that a long-running process is still going and if not, start it? If I start a long-running process in cron, is it going to ...
5
votes
3answers
4k views

Monitor all newly spawned processes on a Linux machine

Sometimes a process comes and goes faster than I can ps aux, I tried watch -d -n0.1 "ps aux | tail" but again, that's restricted to 1/10th of a second. What I really want is to run a command and ...