An instance of a running computer program.

learn more… | top users | synonyms (1)

90
votes
9answers
29k 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 ...
62
votes
8answers
32k 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 ...
37
votes
22answers
3k views

What's the biggest time saver you've implemented?

Which changes that you have implemented did have the biggest impact on saving time in you daily sysadmin workload? What are your tricks to work more efficient and get more things done or work less for ...
33
votes
5answers
5k 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 ...
25
votes
5answers
2k 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
4answers
20k 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 ?
19
votes
3answers
35k 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 ...
17
votes
3answers
9k 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. ...
17
votes
6answers
15k 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
9answers
995 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 ...
13
votes
3answers
4k 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
3answers
18k 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 ...
12
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. ...
11
votes
6answers
6k 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 ...
11
votes
3answers
16k 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
10
votes
5answers
31k 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?
10
votes
4answers
18k 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 ...
10
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
5answers
3k 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)
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
3answers
4k 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 ...
8
votes
4answers
23k 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 ...
8
votes
1answer
5k 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 ...
7
votes
5answers
2k 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
5answers
17k 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 ...
7
votes
8answers
3k 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
993 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
5answers
38k 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 ...
7
votes
2answers
10k views

How to configure a Windows service process to run with low priority?

Is there a way to configure a Windows service process (e.g. squidNT, SQL Server, etc) to start automatically with low priority without manually changing process priority via Task Manager?
7
votes
7answers
16k 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
212 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
431 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
4answers
1k 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 ...
6
votes
4answers
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 ...
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
2answers
3k 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. ...
6
votes
5answers
5k 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 ...
6
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 ...
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
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 ...
5
votes
4answers
8k 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
6k 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
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 ...
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
1answer
24k 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?
5
votes
2answers
669 views

Run a pool of processes in shell

I'm looking for an easy method to run N selected processes at the same time with one command. It should put all the output on my terminal and shut down all of them when I exit with ctrl+c. Is there ...
5
votes
3answers
166 views

Sort Active Processes in Unix

How can i sort active processes by total process time in unix?
5
votes
4answers
243 views

Process monitoring services

I'm looking into different services that help keep processes up and running (auto-restart in the event of a crash). Which ones do you prefer and what are your commends/suggestions? Here are a few ...
5
votes
1answer
824 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 ...
5
votes
4answers
5k views

What's a proper way of checking if a PID is running?

I have a .pid file, and I need to check if the process is running. So far I found two options kill -0 `cat something.pid` which prints out an error if the pid isn't running. I know this can be ...