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

learn more… | top users | synonyms (1)

3
votes
2answers
1k views

wait does not wait

If i have a file called myprogram containing sleep 200 date Run this in the background: $ sh myprogram & i want to know when myprogram has completed by using wait command $ cat >notify ...
3
votes
1answer
497 views

Redirecting/grep'ing an existing shell's STDOUT

I run a lot of long running processes (simulations) that print progress to STDOUT. I occasionally forget to redirect to STDOUT to a file I can grep, and it's usually too far along to restart. ...
3
votes
1answer
8k views

How do you make a cross-process locking in Linux (C/C++)?

I need to make sure one process executes only in one instance at a time. On Windows you could use named mutex. But I have no idea what to use on Linux. I think I've seen an approach were app creates ...
3
votes
2answers
500 views

Need for thread_info structure in Linux 2.6 Kernel

Prior to the Linux 2.6 kernel, struct task_struct was present at the end of the kernel stack of each process. There was no thread_info struct concept. But in Linux 2.6 kernel, instead of task_struct ...
3
votes
2answers
35 views

What are the default stdin and stdout of a child process?

I would like to know what are the default stdin and stdout of a child process (if there are such defaults). Are stdin and stdout of a child process the same as its parent process? Is this something ...
3
votes
3answers
64 views

When interrupting a process, does a memory leak occur?

Lets say I created a program in c/c++, where I manually allocated some variables. Then while running the program, I send an interrupt signal (Ctrl-C). Are those variables freed from memory, or will ...
3
votes
2answers
56 views

How can I kill process by specific name and exclude root processes

Not a long time ago we found out about pkill and we had in mind to start using it in a setuid (for root) script for global clean-up of processes. This could save us lots of stupid maintenance where ...
3
votes
1answer
72 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 ...
3
votes
1answer
148 views

Long-running R script is getting killed automatically

I'm attempting to run an experiment for my masters thesis that involves an R script that has to run for quite a while (up to 24 hours of 100% cpu usage). It's a single-core process, and as far as I ...
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
477 views

How can I know thread names that run on specific core

I am working in Java code. My code makes specific Java threads run on specific cores. In this code, I give names to Java threads. I need a Linux command that enables me to know the threads' names that ...
3
votes
1answer
90 views

Result from kernel returned to what process?

When a process requires actions that require kernel mode, it uses a system call. So, how are the results returned to the process?
3
votes
1answer
2k views

Difference between process in background and daemon [duplicate]

What is technically the difference of a process that started in foreground and was manually put into background and a daemon? Do they have different properties?
3
votes
3answers
475 views

How do I know if acct is running? (The Unix system accounting)

I have installed the acct package and it is running because I can see file activity in the log file. I know there is the command accton on to turn it on, but how do I determine that its running short ...
3
votes
4answers
1k views

Capture complete process structure/stack

There are a lot of java processes running on the server, generally, we capture the PIDs of the java processes using command 'ps -ef | grep java'. In general, the java processes have a lot of jars in ...
3
votes
2answers
1k views

Which script from /etc/init.d/ started the process?

Let's say we have a PID of a process and we know that it was started by init during startup. How do we find the script name that started it? One way is to run grep $PROCESS_NAME /etc/init.d/*, but ...
3
votes
2answers
1k views

How can I kill the top CPU/IO process quickly?

I find that sometimes my Linux will stop responding, so I need to switch to another terminal with CtrlAltF2, and type a command to kill the top CPU usage process or top IO usage process, so that the ...
3
votes
1answer
1k views

Solution to get data from memory of a process

If I'm using Firefox and filling out a big form (with lots of text to write), and for some reason I accidentally press F5 and all my text in the forms is lost, I can use e.g. HxD on Windows to ...
3
votes
2answers
393 views

Monitoring process activities using system calls only (without utilities like `top`)

I want to obtain information about memory used by different users and different processes which users are running and statistics about those processes like memory consumption, execution speed, etc., ...
3
votes
2answers
2k views

A tee >( process ) is truncating its stdout when writing a file

When I use tee to pipe stdout directly to a "specific block of code" (which then writes the modified data to a file), I always get the full complement of exptected output lines in the file. ...
3
votes
1answer
958 views

Start X as a user other than root

I know some distro's (Moblin? ) have X starting as a user other than root already... What is required to do this? What steps need to be taken? I don't think it matters but I think X is started by KDM ...
3
votes
1answer
72 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 ...
3
votes
1answer
50 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 ...
3
votes
4answers
706 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 ...
3
votes
1answer
121 views

What could be happening between pidof and kill to cause “no such process”?

I've inherited quite a bit of code and am looking at a cron job that restarts a service once an hour, no other scripts touch this process and this code is ran. #The name of the process has been ...
3
votes
1answer
974 views

Limit maximum number of concurrent scp processes running on a host

I am facing a problem where I have a fleet of servers which contain a lot of data. Each of the host runs many instances of a specific process p1, which makes several scp connections to other hosts in ...
3
votes
1answer
170 views

How to find the file corresponding to a pipe opened by a process? [duplicate]

I created this script, which listens for characters received on a hardcoded pipe, and tries to eval those characters. I call my script loop_executor.sh This is all it contains: !/bin/bash while : do ...
3
votes
1answer
244 views

strace works for some builtin commands

I'm trying to understand some kernel level concepts in Linux. I was checking on the difference between shell builtin commands and the other executable commands. This wonderful answer clearly tells ...
3
votes
2answers
2k views

Find the PID's of all threads of a process without ps or pidof

So the system I'm working on (BusyBox) has a ps that takes no command line arguments and pidof returns nothing even though it exists within /sbin and points to killall5. Another issue I had is that ...
3
votes
2answers
97 views

What information about a process is retrievable after it is terminated?

After a process has been terminated, is it possible to retrieve any information about it, such as when it started and finished, &c. Is it possible to enable logging of this information?
3
votes
1answer
1k views

Linux: How to check whether a process is slowed down by other running processes

I have one process running on a RHEL 6.3 machine. Somehow this is taking a longer processing time than the same process running on another machine. How is it possible to know why this process is ...
3
votes
1answer
3k views

Cannot kill a java process

I have a java process that cannot be killed. I have tried every method I know, or that I have found on the internet to no avail. I have tried: killall java kill -9 <pid> kill -11 <pid> ...
3
votes
1answer
3k views

Program stall under user but runs under root

I am running R job under a normal user john and root. Interestingly, the program stalls under john user but runs quickly under root. Using strace, I found that when john runs the R, the process stalls ...
3
votes
1answer
187 views

how to disallow user to change process group

Is it possible to restrict a process from changing it's process group? For example, user nobody seems to be able to call setpgid(0, 0) which sets process group of current process to pid of that ...
3
votes
3answers
336 views

How do I see more of the command line with the KDE System Guard Process Table

I often have several java programs running and I can't tell which one needs to be killed. The command section of the process table only shows java, but doesn't tell me which jar or class files it is ...
3
votes
1answer
80 views

Can I exec an entirely new process without an executable file?

Suppose my non-root 32-bit app runs on a 64-bit system, all filesystems of which are mounted as read-only. The app creates an image of a 64-bit ELF in memory. But due to read-only filesystems it can't ...
3
votes
3answers
67 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 ...
3
votes
1answer
132 views

Resource (CPU time and memory) limitation and termination of a process upon violation in Linux

The problem: Given a process, limit the resources it and its child-processes can use. I.e. set CPU time and virtual memory quotas. When the process group exceeds one of the limits, terminate it, ...
3
votes
2answers
110 views

Sum the memory usages of all the processes of a program?

How can we sum the memory usages of all the processes of a program? For example, I have opened many Chrome tabs for webpages, and each tab runs a different process. How can I get the total sum of ...
3
votes
2answers
155 views

How to update user/group settings of a running process?

Suppose I change some user settings like its initial login group or add it to a new group. I now can do su user and work with these new settings. But all the previously running processes will still ...
3
votes
2answers
1k views

Does jps lie? If not, what else is this?

I am running dockerized hadoop cdh 4.6.0 with supervisor . I have opened the docker container and tried the following two commands. Got confused a lot. jps 103 -- process information unavailable ...
3
votes
1answer
212 views

Identify in which screen instance a process is running

A process listening on port 8113 (Solr) is not responding. I've found its PID via netstat but the server has about two dozen Solr process running in various screen sessions. 3607.foobar-client2 ...
3
votes
1answer
140 views

Retrieve X11 window ID of a just-launched GUI-program

I want to retrieve the X id of GUI programs I launch in background, in order to work on their windows properties. I've been so far using this workaround: myprogram & sleep 1 winID=$(wmctrl -l | ...
3
votes
1answer
281 views

Why does the 'user' and 'sys' time vary on multiple executions?

There is a nice question and answer explaining the relationships between 'real', 'user' and 'sys'. It explains the reasons why 'real' can vary, and defines the 'user' and 'sys' as times the process ...
3
votes
1answer
89 views

Is each process considered a thread?

Is a Linux process considered a thread? For example, if I write a simple c program that calls pthread_create to create a new thread in main(), does that mean that I now have 2 threads, one for ...
3
votes
1answer
151 views

What is the rtsbpp-polling process doing?

In Ubuntu 12.04 LTS when I run the top command I see a process called rtsbpp-polling. Googling it gives only just a few hits to the Gentoo Linux forum that does not seem to be relevant (they don't ...
3
votes
1answer
1k views

When do jiffies increment? How a process runs in a jiffy?

I know that jiffies length is selected at kernel compile time and it is defaulted to 250 (4ms). Source: man 7 time - The Software Clock, HZ, and Jiffies I wonder what happens inside a jiffy. What are ...
3
votes
1answer
1k views

How do I detach a process from its parent? [duplicate]

Possible Duplicate: How can I disown a running process and associate it to a new screen shell? The problem is that the process is not a job inside of my active shell (as I've logged in from ...
3
votes
1answer
1k views

Limit process resource consumption in CentOS 5 (2.6.18 kernel)

I would like to limit the resource (CPU, Memory, and network bandwidth) consumption of processes on the same server. And it will be good if I can migrate processes from one server to another. I ...
3
votes
2answers
1k views

How to trace a process to original user?

Say, on a Solaris server, user1 logs in, switches to someother user, say sruser, using su - and then starts a process of id X. And then another user user2 logs in, switches to sruser the same way and ...