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

learn more… | top users | synonyms (1)

1
vote
3answers
16k views

How to get the Job ID? [duplicate]

As we know, the shell enables the user to run background processes using & at the command line's end. Each background process is identified by a job ID and, of course, by it's PID. When I'm ...
4
votes
3answers
387 views

How does getpid work?

The getpid system call returns the process id of the invoking process. How does the kernel figure out which process is invoking the system call ?
2
votes
2answers
14 views

Why do multiple instances of Mate-terminal have the same PID?

I've noticed, that all mate-terminal instances I start, be it inside a mate-terminal or via a link button, have the same PID. For example, I got something like $ wmctrl -lp <omitted lines that ...
3
votes
1answer
20 views

Shared library mappings in /proc/pid/maps

Why does /proc/pid/maps contain a few records for the same library ? Here is an example: 7fae7db9f000-7fae7dc8f000 r-xp 00000000 08:05 536861 ...
1
vote
0answers
34 views

Constant 60KB Shared library memory on /proc/<pid>/maps [duplicate]

In a quest for understanding RAM requirements of system processes, I arrived to analysis of /proc/pid/maps. I have noticed a pattern: many shared libraries have exactly 60KB space allocated in their ...
1
vote
1answer
7 views

Outputting PID of Rails server(s) with ps aux | grep - breaks when put into an alias?

I'm trying to create an alias for an unwieldy command I'm using to output the PID and some other information about two rails servers I have running. When I simply run the command in terminal (over ...
0
votes
1answer
25 views

How to run bunch of hierarchical dummy shell processes (process of another process, etc.)?

I would like to run multiple processes where each process is running another one, so it will create a long process branch. I've tried: $ bash -c '(bash -c "sleep 20"); sleep 20' & $ pstree ...
35
votes
2answers
12k views

Why does `htop` show more process than `ps`

In ps xf 26395 pts/78 Ss 0:00 \_ bash 27016 pts/78 Sl+ 0:04 | \_ unicorn_rails master -c config/unicorn.rb 27042 pts/78 Sl+ 0:00 | ...
10
votes
2answers
425 views

How does a shell execute a program?

If I compile a program using gcc, and try to execute it from the bash shell, what is the exact sequence of steps followed by bash to execute it ? I know fork(), execve(), loader, dynamic linker (and ...
0
votes
2answers
21 views

Which tool can be used to configure the CPU priority of a process?

I know that you can use nice to re assign priorities of processes but which tool can be used to configure the CPU priority of a process ?
4
votes
1answer
46 views

What is /proc/<pid>/net/dev?

I'm interested in per-process network I/O counters, like those in /proc/net/dev and found what I thought was it under /proc/<pid>, i.e. /proc/<pid>/net/dev. But it seems that was too easy ...
2
votes
3answers
36 views

Who forks the processes of piped commands in the shell?

Suppose this command in the shell : ls|less Now we know that ls and less are run as two different processes. We know that the shell forks and creates a child process which load the ls program using ...
18
votes
1answer
9k views

What is the maximum value of the PID of a process?

What is the maximum value of the PID of a process? Also, is it possible to change the PID of a running process?
1
vote
1answer
26 views

Memory usage of a given process (using Linux proc filesystem)

I want to know which files from /proc directory and which fields of these files I need to calculate the memory usage of a given pid. I've been using the "stat" file and the "vsize" parameter that is ...
4
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 ...
1
vote
1answer
45 views

Allow a single process to access a file

If I am the owner of a file, then is there a way I can give another process (running under another user that doesn't have read/write permission to that file) permission to access it? I want only that ...
4
votes
4answers
50 views

How do see the memory used by a program in ubuntu?

How can I see the raw memory data used by an application ? Like , suppose I have a file name something.sh . Now I run the command ./something.sh , and then I want see all the data its accessing in ram ...
10
votes
2answers
2k views

Why does process substitution result in a file called /dev/fd/63 which is a pipe?

I am trying to understand named pipes in the context of this particular example. I type <(ls -l) in my terminal and get the output as, bash: /dev/fd/63: Permission denied. If I type cat <(ls ...
0
votes
1answer
12 views

Are blocked and blocked/suspend processes put into the same queue?

In a 7-state process model (new, ready, blocked, running, blocked/suspend, blocked/ready, exit), are processes in the blocked and blocked/suspend states for each event that processes are blocked on ...
2
votes
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
2answers
40 views

defunct process - is it always a child process?

reading on what is a defunct process says that it is a child process which when it terminates/end is not properly handled/killed by its parent. but viewing on the below output servera> ps -ef | ...
1
vote
1answer
18 views

What module in the kernel that inform the DHCP client to start DHCP negotiation?

DHCP client is a process instead of kernel code. How the DHCP client know when to start sending DHCP discover message? Is it the IP module in the kernel that inform the DHCP client?
15
votes
2answers
224 views

Process which locks up, ignores SIGKILL, is runnable (not a zombie or in uninterruptable sleep). What state is it in?

I have a process which several times now has stopped responding and appears to be completely locking up. It doesn't respond to any attempt at strace or peeking with gdb (gdb just hangs on a wait4() ...
1
vote
1answer
22 views

Restrict a process to accessing only a specific directory

How could I run a process dostuff such that it can only access files/folders in the directory somedir?
1
vote
3answers
42 views

What is the output of “du” command during a long copy ?

Recently, I have launched the cp command to create a backup of a big directory. So, I used a command like that : cp -rv big_directory new_location Because files are big, it took long time to ...
0
votes
2answers
18 views

How to get PPID with PS using BSD options

I'm looking for a ps string that will give me all the output headers of "ps aux" but with the PPID. So far, I can only get the PPID column using ps -ef. I have tried numerous combinations but have ...
0
votes
3answers
51 views

Killing a comet zombie

I have a zombie process that is changing its PID, which is increasing. Is it possible to kill a process with PID greater than N?
1
vote
1answer
47 views

Killing PGIDs but proceses are respawning, how do I make it persistent?

I ran ps aux --forest -j to see parent and child processes. Here is an example: root 3744 3744 3744 0.0 0.2 77084 4160 ? Ss 09:34 0:00 /usr/sbin/cupsd -f lp 3747 3747 ...
1
vote
2answers
703 views

Why I can not use all the 100% potential of CPU?

I am using my computer clusters to run a MD C program but I can not use full potential of those clusters. But the this node have 16 CPUs and I also only give 15 jobs for those CPUs. But I can not ...
1
vote
1answer
32 views

Is it better/preferred to kill all child processes by using PPID or PGID?

I need the ability to kill all child processes running under a particular parent. What would be the better option to do this? Using PPID or PGID? Something like this: pkill -TERM -P Would kill ...
3
votes
3answers
49 views

How to start two processes piggie-backed? So the first finishes when the second finishes?

I'm running a script with ssh commands to a server behind a jump-host. Each time I want to run a command on my server in the secure network, I need to ssh into the jump-host (bastion) server and run ...
2
votes
0answers
30 views

Restrict a user from viewing other user's processes [duplicate]

Suppose there are two users : user1 & user2. Now we know that if I give top -u user1, I can see only the process respective to user1. But if I do top -u user2, I can see all the process running ...
14
votes
2answers
4k views

tmux session lost in unknown pts, cause and possible solution?

I was trying to re-attach to a long-running tmux session to check up on a python web-application. However tmux attach claims that there is no running session, and ps shows a tmux process (first line), ...
29
votes
6answers
7k views

Who's got the other end of this unix socketpair?

I want to determine which process has the other end of a UNIX socket. Specifically, I'm asking about one that was created with socketpair(), though the problem is the same for any UNIX socket. I ...
1
vote
1answer
768 views

How can I kill child processes with start-stop-daemon?

I'm writing a simple web server using nc and bash. It looks like this: #!/bin/bash rm -f /var/run/streamman/out mkfifo /var/run/streamman/out trap "rm -f /var/run/streamman/out" EXIT while true do ...
0
votes
0answers
26 views

Start a process from (noninteractive) shell script (cgi) and keep it running when script ends

I want a cgi script to start a process which stays alive after the cgi script exits. I tried: #!/bin/bash nohup process-to-keep-running & That works fine, if I run the script from an ...
6
votes
2answers
11k views

How to see complete list of processes in top

When I do 'top', I learn that there are many processes running out of which many are in sleep state. I need to see complete snapshot of all processes at that point. the 'top' is able to show listing ...
3
votes
1answer
262 views

How to switch to other users's process?

A user has started a Java program and is currently running. As root, I can see it through ps -A. How can I bring this process to foreground?
0
votes
1answer
101 views

Linux ps -elf command output, what is Process Flag meaning?

In output of ps -elf command in linux, we can recognize that process flag of 4 and 1, and process flag of 5, (sum of 1 and 4), but what is meaning of process flag 0 ? unfortunately, man does not help ...
0
votes
1answer
25 views

Open ports with no associated PIDs

I have some open ports on my laptop but netstat is not reporting which PID/Program is associated with them: $ netstat -tulpn (Not all processes could be identified, non-owned process info will not ...
11
votes
2answers
2k views

how to find out namespace of a particular process?

I already asked a question about how to list all namespaces in Linux, but there wasn't any correct and exact answers, so I want to find out a method which can help me to find out the namespace of PID ...
6
votes
1answer
65 views

Is it possible to add a process to the job list in bash (e.g. to reverse “disown”)?

If I disown a job in bash and change my mind, can I undo it somehow ? If so, taking it further, is it possible to bring an arbitrary process under job control (an acceptable restriction would be that ...
1
vote
2answers
28 views

Directory in /proc that isn't process dir but start with number?

Quick question. Is it possible to create directory in /proc that starts with number but isn't process directory (where name is PID)? I write software that searches for process directories and I wonder ...
23
votes
3answers
1k views
3
votes
2answers
180 views

What does p and e denote in exec family of calls?

l and v in exec calls denote whether the arguments are provided via list or array(vector). I read it somewhere that p denotes the user's path and e denote the environment but did not understand what ...
1
vote
1answer
31 views

Restricting CPU time of processes by executable path

Is there a way to restrict CPU time (duration) for all processes which are invoked by executables that are located in a certain directory? I would like to be able to auto-kill all applications which ...
1
vote
3answers
44 views

What does it mean to run a process in background? [duplicate]

What exactly does it mean to run a process in the background? The difference between $program and $program&: Is it just that the input file descriptor is not inherited from the shell or is there ...
4
votes
2answers
151 views

Zombies in bash

Bash doesn't seem to create zombies. It looks like the processes get immediately reaped when they get killed. Can I make bash make zombies? Why I'm asking: I'd like to be able to safely kill a ...
3
votes
2answers
85 views

foolproof way to detect if java process is running

I have a java process that runs continually that sometimes, for reasons I have yet to fully debug, craps out. So, I also have a cron job that looks for the process every 5 minutes and if it finds the ...
2
votes
1answer
31 views

How do kernel inform OSPF daemon when a physical interface status is down?

When a physical interface status is changed from up to down, there are 3 things related to the computer's current routing table and OSPF. The (connected) network for that interface and remote ...