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

learn more… | top users | synonyms (1)

2
votes
1answer
18 views

Get all files open for writing with pid, recursively

Given a pid, I can get all the files open for writing something like: lsof -p 28827 | awk '$4 ~ "[wW]"{print $(NF-1), $NF}' One of those ends up being a pipe: 28827 232611 pipe I want to look-up ...
4
votes
0answers
29 views

How to enable random PIDs on Linux?

I'm currently comparing random PID implementation on OpenBSD, FreeBSD and Linux from security perspective. As long as OpenBSD and FreeBSD are concerned, my work is done. However, while the answer ...
19
votes
3answers
17k views

Which process has PID 0?

I'm looking for the process started in Linux which has process ID 0. I know init has PID 1 , which is the first process in Linux, is there any process with PID 0?
-2
votes
1answer
90 views

How are zombie processes handled when the parent dies?

Which technique does the Unix system use to remove zombie processes whose parent has terminated?
5
votes
0answers
40 views

What to do when “nice” isn't good enough (FreeBSD)

I've been using x265 to encode some video on my workstation lately, but I have a problem: even though I launch it using nice -n 20 x265 to deprioritize it, it still slows the computer to a crawl while ...
0
votes
0answers
7 views

Sequential process execution? [on hold]

How do I create multiple processes and run them in a certain sequence? The scheduler should not switch context. I am running a set of at least hundred programmes which must repeat after sometime while ...
4
votes
4answers
185 views

Are the states of processes which are ready and scheduled to wait “S”?

In the output of top, the state S means interruptible sleep. What is the state of those processes which are scheduled to be ready and waiting for execution in CPU by the scheduler? Is it S or ...
3
votes
4answers
44 views

How to get the PID of a sub process across to the parent process in a bash shell script?

My shell script is as following: #!/bin/bash ./process1 #It will create a sub process: sub_process1 while [ condition ]; do break done kill -9 process1 and sub_process1 In my script, it will ...
0
votes
2answers
25 views

Is there a need to get rid of a zombie process? [duplicate]

I read somewhere (forgot where) that a zombie process continues to consume the process table entry (concretely the process identifier or PID), and causes a resource leak. Is it correct that a zombie ...
0
votes
2answers
685 views

How to disable core dump generation in Centos (cPanel Server)?

I want to disable core dump generation, How can I disable it ? One of the website keeps generating core dumps every second and eats up all the disk space. OS Details: CentOs cPanel Server ...
5
votes
2answers
60 views

What are pending signals?

When looking at the limits of a running process, I see Max pending signals 15725 What is this? How can I determine a sensible value for a busy service? Generally, I can't seem to find a ...
3
votes
4answers
98 views

Run multiple commands and kill them as one in bash

I want to run multiple commands (processes) on a single shell. All of them have own continuous output and don't stop. Running them in the background breaks Ctrl-C. I would like to run them as a single ...
2
votes
0answers
29 views

Identify process

Every couple of minutes my Mac OSX machine starts running a process that consumes 10% of the CPU. It runs for a couple of seconds and then stops. I can see the process coming up in 'Top', but the name ...
2
votes
0answers
47 views

How to keep my C program from terminating when CTRL-C is pressed? [migrated]

AFAIK this has something to do with "catch the SIGINT" but I'm looking for more details. Like many others I learn C by writing my own CLI that can start other program located by the environment ...
4
votes
0answers
43 views

Is it possible to make an exec call that “returns”?

Is there a way to make the exec system call work like a function call that returns instead of totally replacing the current process image? My motivation is trying to integrate two shells with ...
1
vote
0answers
35 views

Create tree of processes

I'm implementing pstree as an assignment, and I would like to create test tree of processes, but I'm struggling to do so. I tried to do something like this to create tree of background processes ...
0
votes
1answer
28 views

Killall processes under a user?

So, I know you can pkill -U <uid>, but whenever I've used this, my entire system crashes. Further investigation shows it probably is because I'm not matching anything, so it matches everything? ...
21
votes
1answer
34k views

There are stopped jobs (on bash exit)

I get the message There are stopped jobs. when i try to exit a bash shell sometimes. Here is a reproducible scenario in python 2.x: ctrl+c is handled by the interpreter as an exception. ctrl+z ...
2
votes
3answers
3k views

Cron job to check if PHP script is running, if not then run

I am wondering if someone might point me in the right direction. I've got little experience working with the Linux command line and recently due to various factors in work I've been required to gain ...
0
votes
1answer
486 views

Very large values for utime and stime for foo. Is foo still running?

I am running a program foo It has been running for close to 30 days now (even more) Until around 10 days ago (I cannot be very exact) it used 100% of one cpu on my dual core laptop (it was at the ...
8
votes
2answers
17k views

ps switches to display PID, PPID, PGID, and SID collectively

I tried ps with different kinds of switches e.g. -A, aux, ef, and so forth but I cannot seem to find the right combination of switches that will tell me the Process ID (PID), Parent Process ID (PPID), ...
1
vote
2answers
4k views

How to know if a background job is finished?

I invoke a script (do_something) in background via another script (do_manythings) as below. nohup do_something & How would I know in the parent script (do_manythings) that the job invoked ...
1
vote
4answers
181 views

How to set the process won't be terminated when the terminal stops

[Edit] Make it simple. I invoked java xxx... on Machine A using putty to connect from Machine B. However I cannot reach Machine B. How can I connect Machine A from Machine C to set the running ...
0
votes
1answer
39 views

How to resume a process from an SSH connection?

At work, I have lot's of interactive scripts running that I would like to access them later on from home. If I do Ctrl+Z to them and then bg, then I am able to use them from home using the fg command. ...
14
votes
4answers
6k views

How to kill a process with a single command?

I want to kill a process, after finding the id in a single step. I currently use these two commands: pidof <name> kill <#number_which_is_result_of_command> How can I write a single ...
1
vote
1answer
24 views

setpgrp causes tty gone

When using setpgrp vi (and other tty programs) work completely different than if setpgrp is not used. Example: perl -MIPC::Open3 -e '$pid= open3("<&STDIN", ">&STDOUT", ...
6
votes
1answer
6k 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 ...
0
votes
3answers
25 views

processes started in this session

I've opened a terminal session and started some processes with &. When I tried closing the terminal window, it warned me that there were still jobs running in the background. I can see the ...
2
votes
1answer
3k views

How to check which process is using most memory

When I check free in one of Prod server it showing 70% of memory is being used: total used free shared buffers cached Mem: 164923172 141171860 23751312 ...
0
votes
1answer
52 views

Portable way to kill a process listening on a given port

Is there a way to kill a process listening on a given port (e.g. in bash lsof -t -i tcp:8000 | xargs kill) from a shell script that will also work on cygwin, as well as bash?
1
vote
1answer
34 views

How to start (or find) a process with RUID different from EUID?

Inspired by one of the previously answered questions, I tried executing a program by a user who was not its owner -- and the process's RUID and EUID remained the same. (Unless I read the answer wrong ...
0
votes
1answer
31 views

What is Dynamic interleave for process in Linux?

I have read through the source defined in /source/mm/mempolicy.c. Starting at line 1178: /* Do dynamic interleaving for a process */ static unsigned interleave_nodes(struct mempolicy *policy) { ...
17
votes
7answers
6k views

Is there a way to limit the amount of memory a particular process can use in Unix?

I need to test a process for memory management. I do not have the source, so I need to do all the testing from the OS side. I want to be able to say something like limitmemory 400k -p <pid> ...
4
votes
1answer
40 views

CPU usage of file system operations not shown in top

I run the following command (which does ls for 10,000 times) in a Ubuntu Linux terminal and use the top command to monitor the CPU usage. While top shows the total CPU usage (line 2) is about 48% ...
1
vote
2answers
66 views

Spawn multiple processes with a single command

Is there a way to create say 10 instances of a process (for example yes) with a single command? $instantiate 10 yes
1
vote
2answers
1k views

Discrepancy between reported used memory and sum of application memory usage

I'm running a desktop system that quite regularly suffers from lack of memory, this prompted me to investigate what causes the issue in the first place. Problem is, there's no single process that ...
0
votes
0answers
32 views

Why does my redhat 5.11 system have so many ext4-dio-unwrit processes?

I have a redhat 5.11 system running, and it looks like there are 32 of these processes. What are they, and why are there so many of them?
4
votes
2answers
58 views

How to kill a bunch of jobs based on ps output?

Here is output from ps: $ ps aux | grep blob ubuntu 4286 0.0 0.1 34748 9592 ? S Jan14 0:00 /usr/bin/python /usr/local/bin/pynt start_blob_reader ubuntu 4287 0.0 0.1 34748 ...
1
vote
1answer
34 views

process id and command

I want to write the process id and command of all processes with some name and from some user (for example root and init). What should I do? ps -f -u root -C init or ps -f -U root -C init ...
2
votes
2answers
31 views

Replace screen process from within screen

I have configured my shell to exec screen when it starts, unless it's already running within a screen session. So in a TTY, the process tree will look like something like this: ...
6
votes
5answers
3k views

How do I start a process with a nice value of -20 and not give it root privilege?

I would like to start a process with a nice value of -20. This requires me to use a command like - sudo nice -n -20 matlab. However, this starts matlab as root too. Is there a way to have matlab as ...
28
votes
5answers
5k views

Block network access of a process?

Is it possible to block the (outgoing) network access of a single process?
26
votes
5answers
74k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
2
votes
1answer
44 views

Traverse the Process Tree

I am aware that processes are organized in the form of a hierarchy. So, if I want to implement an operation which is to determine whether a given process belongs to a given sub-tree in the hierarchy ...
0
votes
2answers
43 views

Best way to kill processes in a list

I've got this zsh script. Is there a more a graceful way to do this? export PROCESSES_TO_QUIT='puma rake sidekiq spring rails ruby-debug phantomjs zeus passenger guard resque "node server.js"' pgr() ...
3
votes
1answer
1k views

How to get start time for a defunct process on AIX?

When I run the following commands on AIX: 22:root@SERVER:/root # ps -ef | head -1 UID PID PPID C STIME TTY TIME CMD 22:root@SERVER:/root # ps -ef | grep defunct | head -1 ...
2
votes
1answer
65 views

Command for killing specific PID provided by previous command

Sometimes I need to kill a process (the reasons why are not important). And I know I can find that process with the following command: lsof -i :8080, being my candidate the last process in the output ...
0
votes
0answers
10 views

How is a process state updated to blocked state (TASK_INTERRUPTABLE)? [migrated]

When a process is waiting for IO, how is the task state updated to TASK_INTERRUPTABLE (that is, blocked)? Imagine this case, a process issues an IO request to a block device. According to my ...
23
votes
3answers
39k views

Find and remove large files that are open but have been deleted

How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open? The situation is that we are running a ...
1
vote
2answers
1k views

How do I run two ongoing processes at once in linux/bash?

I would like to know how I can run two ongoing processes at the same time in Linux/bash. basically, I have a Node web server, and a MJPG-Streamer server. I want to run both these processes at once, ...