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

learn more… | top users | synonyms (1)

3
votes
1answer
73 views

sigint not being propagated to background child process

I need to send SIGINT to terminate a process gracefully but I can't. This is a sample, because the environment in which the execution occurs is 'unknown' (a bash script in travis.com) I managed to ...
0
votes
1answer
52 views

Schedule a job to run in the background ( one time task scheduling using at )

Is it possible to request for a job to be run at a later specifed time in the background? This is what I have so far, nohup nice MY_PROGRAM > foo.out 2> foo.err < /dev/null | at 05:23 PM ...
1
vote
1answer
33 views

what happens to remotely run process when remote host disconnects?

Say, I ssh into a remote host, initiate few processes on it and disconnect before the processes terminate. What happens to the processes? Do they continue?
33
votes
7answers
103k views

Is there a way to see details of all the threads that a process has in Linux?

For Windows, I think Process Explorer shows you all the threads under a process. Is there a similar command line utility for Linux that can show me details about all the threads a particular process ...
2
votes
3answers
124 views

How to wait for all spawned and backgrounded processes to finish in bash script

I've looked and looked and can't find a working solution to a bash script I'm trying to create to shut a process down and wait for it and spawned processes to finish. I'm still learning a lot of ...
4
votes
2answers
477 views

How to wait for the copying process (cp) to finish?

I want my RPi 2 (with MiniBian (a minimal version of Debian-based Raspbian OS) as its OS) to execute a script when it detects a USB flash memory is inserted. So this is what I have done: I created ...
0
votes
1answer
34 views

Linux applications, user and system

I was wondering if there was any CLI command that would allow me to see what applications are being run by the current user, but ones that are not system commands. for example if I run lsof it will ...
1
vote
0answers
25 views

Real-time monitoring of changes in swap use (per process)

I'm looking for a way to observe which processes in my system are consuming an increasing amount of swap over time. The following function generates a list of swap user per process : sbp(){ grep ...
0
votes
2answers
52 views

Sleep system call and its time parameter

Let's say that we are writing a C program that calls the sleep() function. For instance, by calling sleep(7), the calling thread would be put to sleep for 7 seconds. My question is: Will the thread ...
3
votes
1answer
73 views

How to sort ps output to find processes realtime priority and identify processess currently occupied running queue

How to properly identify real-time processes currently occupied CPU queue and count them using ps? I know there is a bunch of fileds like prio,rtprio,pri,nice but do not know correct to use. It seems ...
4
votes
1answer
117 views

Pulling all of a process's swapped memory out of swap

How would one go about quickly pulling all of a process's swapped memory out of swap without writing to disk? The context on this issue is trivial, as the systemic issue necessitating the question ...
3
votes
2answers
46 views

wait and recycling of PID

I have a concern whereby in a script, I will be calling parallel versions of a function to run in the background and then issuing a wait. a () { sleep $1 } a 10 & PIDs="$PIDs $!" a 50000 & ...
5
votes
1answer
53 views

Can I set a resource limit for the current process tree?

Let's say I'm running on a resource-constrained system, and I want to ensure that the applications I run open no more than 10 files total. If I try to do it using setrlimit, something like: if ...
1
vote
1answer
148 views

Why does running sudo cp show two processes

I am trying to copy some files and folders on a Centos machine. I do it like so: sudo cp source destination & to run it in the background. I see there are three cp processes now when I run ps ...
3
votes
2answers
84 views

How does the Linux scheduler determine if a process is I/O bound or CPU bound

Adding to this question, how does the scheduler determine if a process is I/O bound or CPU bound? Mr. Love in this article, says "schedulers often employ complex algorithms to determine the most ...
1
vote
0answers
45 views

Background processes in ksh script are disappearing after they are kicked off

I'm having an issue with a KSH script that is supposed to kick off four processes in parallel in the background and then poll their status. Put simply, running the four processes sequentially would ...
9
votes
1answer
13k 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 ...
0
votes
1answer
241 views

Process tree using fork() [closed]

I am given the task of creating this process tree in C using fork, if and else: |_____1___ |___2__ | |_4_ | |_3_ | | | | | Or as a pstree like drawing: p(0)─┬─p(1)───p(3) ├─p(2) ...
103
votes
5answers
120k views

How to check how long a process has been running?

I would like to avoid doing this by launching the process from a monitoring app.
6
votes
4answers
656 views

list graphical processes from terminal

Do no confuse the question here with how to list processes graphically, that is not what I am asking. In the Terminal, how can i see which processes have a GUI? as in things like firefox, vlc, ...
4
votes
2answers
79 views

How can I kill my backticked yes process?

I was playing around in my terminal, which runs zsh. I typed the following: $ ` bquote> yes bquote> ` And then, yes started to run in the background, I think. Neither Ctrl + C nor Ctrl + \ ...
2
votes
2answers
115 views

How to set an indentifier for multiple background processes?

I'm creating a custom game server and I have a .jar file to run it. I need to launch multiple game servers on a single virtual machine(like 15). I found, that I could just run them like this: java ...
3
votes
2answers
41 views

How to find what processes run by the user right now?

Once again, I'm a beginner and I can't find the right command. I want to view the processes that I'm currently running.
3
votes
1answer
58 views

`EINTR`: is there a rationale behind it?

Small talk as background EINTR is the error which so-called interruptible system calls may return. If a signal occurs while a system call is running, that signal is not ignored and a signal handler ...
1
vote
1answer
32 views

Retrieve data from mem cache

Newbie to Linux. My application writes to a log file and for some reason it stopped writing to that file suddenly. We have restarted the application to fix this glitch. Is it possible to retrieve the ...
7
votes
10answers
27k views

Bash way to check if a process is already running in the background (and skip re-execution based on that)?

Can I make a bash command line that only runs a certain command if the process is not already running (in the background)? How do I check*, if a command is already running? (so I can add the next ...
2
votes
3answers
234 views

lsof -p PID vs lsof | grep PID

I do not understand the ouput of the lsof command. When i write lsof -p PID I get 4 lines and when I write lsof | grep PID I get hundreds of lines. Shouldn't it return the same result? ...
92
votes
4answers
61k views

How do I read from /proc/$pid/mem under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me $ cat /proc/$$/mem ...
2
votes
4answers
18k views

process id and killing process - ps commmand

Please see the output of below ps command: abc@smaug:~/Desktop$ ps ax | grep firefox 2213 ? Sl 2:01 /usr/lib/firefox/firefox 2644 pts/0 S+ 0:00 grep --color=auto firefox Please ...
2
votes
1answer
97 views

How is sudo interrupted in xterm on Ctrl-C? [duplicate]

Please explain in detail (including tty related stuff) how is a sudo foreground process on a X terminal emulator actually killed on the Ctrl-C. See the following example please: $ sudo -u test_no_pw ...
1
vote
1answer
75 views

Security - Runing Daemon, program as root or user vs sudo su

I have some questions about Linux security: Running a process as root is a big mistake (root has too much power + a program get too much permissions in the system). I always ran processes as a user ...
2
votes
1answer
117 views

Why do I have 9 bash processes, why does one of them take up so much CPU and how do I stop them?

I have 9 different bash processes running at all times (I sometimes get more, for example, I have 37 bash processes now.). I found this question, where OP had a similar issue. But I don't see this as ...
4
votes
2answers
56 views

How do I find the PID of a particular program?

I would like to write a Bash script that searches for PIDs matching a program's name (perhaps using ps ax | grep <PROGRAM> or something similar) and feeds them to pixelb's ps_mem script. ps_mem ...
1
vote
0answers
9 views

How to see the variables current value of a running matlab process on tmux?

I have a matlab process in tmux which is running for days. Actually I need to see the values of calculated variables till now. I thought that, it is good(if possible) to duplicate the process and then ...
0
votes
1answer
43 views

How to extract all links from a given url in a decent time

I'm trying to extract the links from a specified url and redirect them to a file. At first I tried using --spider , this is my code: wget --spider --force-html -m http://file/path 2>&1 | grep ...
30
votes
6answers
9k 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
2answers
32 views

View current user process ancestors and formating the output

I'm using ps -eo ppid,pid,cmd to view all process, and how can I format the output to view like below? Only given PID and its ancestor will print (until init). 23464 current | 23211 bash | ...
50
votes
5answers
7k views

How can I check what signals a process is listening to?

How can I verify whether a running process will catch a signal, or ignore it, or block it? Ideally I'd like to see a list of signals, or at least not have to actually send the signal to check.
30
votes
1answer
1k views

What is a “subreaper” process?

The word "subreaper" is used in some answers. Searching Google also turn up entries where the word is "just used". How can I understand what a "subreaper" is?
1
vote
1answer
29 views

Find the command the application has spawned

Is there a way to find the command by which an application has launched an external process? Motivation: I'm using an IDE Qt Creators which at some point calls a SFTP to transfer a file to a remote ...
2
votes
1answer
33 views

Find process that stalls apache

I'm programming a PHP web page and I started seeing some strange behavior on my computer, at some point apache / php takes to long to show the webpage on the browser (8 secs), first i thought it was ...
0
votes
0answers
15 views

Memory sections for Process and Thread

We know very well that Stack,Heap,Data and Code sections are created when we load any program into main memory.I want to know that what are memory sections created for Thread if I create for same ...
0
votes
1answer
34 views

strace vs web browser

I was trying to strace an iceweasel like this: strace -e trace=connect iceweasel And I was expecting to see calls to connect when I load new pages. Surprisingly, there weren't any. Why so? Am I ...
0
votes
1answer
62 views

which process was running on a particular time in linux [duplicate]

Is there any way to find which process was running on a particular time in linux? I found the disk utilization was 99% and CPU utilization was 100% on two different times yesterday. The issue was ...
0
votes
1answer
33 views

Help with the PS and TTY?

I have this question for you guys: I execute on a different shell 'sleep 600'. I open a different terminal and I executed 'ps' to see my current process , however , I dint see any sleep process. I ...
0
votes
0answers
25 views

Supervisord fails to run a program

I've a program that I try to run with supervisord but keep failing. The following is supervisord configuration: $ cat /etc/supervisor/conf.d/application.conf [program:application-web-1] command=env ...
-1
votes
3answers
31 views

Output of processes and specific users with adding some text

I have tried to output processes for specific user but with adding some text. I can do like it is described in this answer How to see process created by specific user in Unix/linux but I don't know ...
0
votes
0answers
22 views

High CPU usage after Version Upgrade

Not sure if is related to the version upgrade but since I have updated my Raspberry to Linux version 4.1.13+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG ...
62
votes
4answers
15k views

Why do we need to fork to create new processes?

In Unix whenever we want to create a new process, we fork the current process, creating a new child process which is exactly the same as the parent process; then we do an exec system call to replace ...
3
votes
2answers
191 views

Content of /proc/<PID>/cmdline file depends on script shebang?

I have a bash script named test.sh which I start with startproc. In case I use #!/usr/bin/env bash shebang in test.sh, the /proc/<PID>/cmdline file looks following: SERVER:~ # cat ...