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

learn more… | top users | synonyms (1)

1
vote
1answer
36 views

getting pid of two last commands executed in background and do stuff

I wrote this bash: #!/bin/bash eval "(a command) &" pid1=$! eval "(while kill -0 $pid1; do .... ; done) &" #It creates file.txt after few seconds pid2=$! if [ -s ...
3
votes
5answers
250 views

Run a process to particular/dedicated pid only

I have a c program executable or shell script which I want to run very often. If I want to stop/pause or to notify something I will send signal to that process. So every time I have to check the pid ...
3
votes
1answer
52 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 ...
0
votes
1answer
65 views

Process switch with clone() [closed]

I'm new for Linux. Now, I have to write a c program and use clone() to make process do things asynchronous. I've read the manual of clone(); however, I still don't know how to make it work ...
2
votes
1answer
131 views

WITHOUT using network command lines in linux, how to know list of open ports and the process that owns them?

I want to know which ports are used by which processes in embedded-linux. Since it is simple embedded-linux, there are no network command lines such as netstat, lsof. (only basic command lines such as ...
1
vote
3answers
82 views

How do I shutdown the system after a particular process exits

I am downloading some software; I can see the pid of the download process with top. Let's say it's 1001. How can I make it so that my computer shuts down after process 1001 exits?
21
votes
3answers
740 views

If processes inherit the parent's environment, why do we need export?

I read here that the purpose of export in a shell is to make the variable available to sub-processes started from the shell. However, I have also read here and here that "Processes inherit their ...
3
votes
5answers
611 views

Getting pid of bash script from itself

I have a bash script with doing lot of things called script.sh: #!/bin/bash #It #Is #Doing #Things Is there a way that I be able to get the proccess of script and then kill it after 5 minutes? ...
1
vote
0answers
24 views

daemon causes problem to the device [closed]

Currently I am working on one hardware device and we are calling it as a Unit (there are about 100 units). This Unit is built on Ubuntu 12.04. There is one daemon called dispaly_msg which is used ...
2
votes
3answers
117 views

Is there a way to make your process use less CPU?

I want my device to use less CPU to save battery. I have a program that uses a large amount of it. nice won't help as all it does is change scheduling when CPU is at %100, while I don't want it to get ...
0
votes
1answer
36 views

understand if a shell process is in background?

I keep an instance of mutt idling on a terminal, if it is on index or pager I want it to be able to receive a macro from an external process (AutoKey or xdotool etc..), but the external program need ...
5
votes
1answer
438 views

will the same pid be used after getting killed?

I had a file opened using vim editor. It was in a ssh session and since I had been idle for a long time, the session got closed and I had to establish the connection again. I opened the file again ...
0
votes
2answers
51 views

Bind one process to multiple ports?

I have a socket server running and listening for incoming connections on a non-admin port (i.e. > 1024). I would also like for this process to be able to handle another type of connection on a ...
0
votes
2answers
35 views

Use xdotool in a telnet session

I have to simulate key presses in a telnet session, and everything has to be invoked by a shell script. #!/bin/sh telnet 192.168.1.14 50000 xdotool type "404" However, once the telnet session ...
5
votes
5answers
1k views

Threads vs (Forked) Processes

Linux applications generally fork then exec (with execve() ), but Java applications, and certain Apache MPMs use threading. If forking, uses the fork + exec to spawn a process, what is the high level ...
1
vote
1answer
135 views

How to configure the process open file limit of a user?

The default open file limit per process is 1024 on - say - Linux. For certain daemons this is not enough. Thus, the question: How to change the open file limit for a specific user?
2
votes
1answer
77 views

“Kill the biggest process” button

This laptop has an SSD and therefore I decided to omit the swap. This works well in most cases, but sometimes the RAM gets a bit short and the computer gets really sluggish and tends to freeze up. Is ...
3
votes
1answer
71 views

How can I get the wall clock time of a running process?

I started a hash check of a large file and don't want to restart it using time. How can I get the wall clock time without using time at the beginning or using date right before I invoke a command?
2
votes
2answers
182 views

High Idle CPU / Low CPU Load average

After removing APC (alternative php cache), I noticed that there are less pagination access and less dirty pages but in the same time: High idle CPU Very low CPU load (relatively to the time before ...
-1
votes
2answers
462 views

Strange processes: “pro” and “proh” and slow Internet

I have two processes that start automatically and when that happens the internet speed decrease considerably. I tried to killed those processes but they start again, I tried to delete the executables ...
2
votes
0answers
27 views

Getting non-stored password from Icedove

I've recently changed my mail password (because of Heartbleed), but I've forgotten the new one. When entering the new password in Icedove, I didn't think of clicking "remember password", but the ...
1
vote
0answers
68 views

Measuring context switches of a LWP gives incorrect results. Why?

I have a Java thread pinned at my cpu core. It is busy spinning and I see through top that it is running fine: %Cpu0 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : ...
2
votes
1answer
42 views

determine what service is running a script

I share a dev server with some colleagues, it's a Ubuntu server and we have several scripts there, so basically the usual way we run a process is using a screen session. My problem is that when I do ...
0
votes
1answer
144 views

Directory locked! [closed]

I have been trying to install virtualbox using this command: sudo apt-get install virtualbox.qt But I am getting this error: E: Unable to lock directory /var/cache/apt/archives/ I have been ...
3
votes
1answer
128 views

What information can I find out about an eventpoll on a running thread?

Following on from a problem described in "How is it that I can attach strace to a process that isn't in the output of ps?" I'm trying to debug a process that hangs part way through. By using ...
2
votes
0answers
114 views

How is it that I can attach strace to a process that isn't in the output of ps?

I'm trying to debug why our integration tests are taking so long and it looks like they're hanging part way through. I logged onto our test service and saw the following behaviour: root@colossus:~# ...
1
vote
0answers
27 views

How do I confirm if another instance of my package manager is still running?

dpkg is reporting that the database is locked which may imply that another instance of the package manager is still running so how do I check this? I have a Debian based system and this came up while ...
1
vote
1answer
74 views

How to find out a process gets end?

How can I tell when a given process exits? Like when it's done running and stuff. For instance: # Command 1 wget http://releases.ubuntu.com/14.04/ubuntu-14.04-desktop-amd64.iso # Command 2 echo ...
4
votes
3answers
94 views

A way for saving running state of a program

I have a program that will perform a lengthy calculation which may take several days to be completed. Is there a way to save the program's running state; so I will be able to turn off the computer ...
2
votes
1answer
80 views

rkhunter /usr/bin/ssh && /usr/sbin/sshd [Warning]

My last rkhuter scan reported a couple of warnings that deserve to be checked(for my noob eyes). Main reason for my suspect is that i wasn't on the machine at (03-Apr-2014 01:12:12) ->AM I googled ...
1
vote
1answer
65 views

Best way to determine piped command to shell script?

Given tree /some/directory | print.sh Is there any way for print.sh to know that "tree -f /some/directory" was called, without trying to parse pid processes?
2
votes
2answers
159 views

How can I get the version of the pgrep & pkill commands?

I looked at the manpages and there is no -v or --version argument for pgrep or pkill. How can i get some info on the version? I'm asking because on my version of Ubuntu man pgrep is giving me a ...
1
vote
1answer
46 views

Will a running program be killed if I suspend my OS?

I am running a program. If I suspend my OS (Ubuntu 12.04) in the middle, will the process of the running program be killed? If not, when I wake up my OS, how can I resume the process? Thanks!
7
votes
1answer
145 views

Reliable way to jail child processes using `nsenter:`

I know that Linux namespaces, among many other things, can be leveraged to handle restricting and jailing child processes securely without any chance of their being zombied and dumped on init. But I'm ...
6
votes
5answers
2k views

Kill all descendant processes [duplicate]

I'm writing an application. It has the ability to spawn various external processes. When the application closes, I want any processes it has spawned to be killed. Sounds easy enough, right? Look up ...
2
votes
2answers
81 views

why cpulimit makes process STOPPED?

I'm running a python script which uses networkx package to run some algorithms on graphs. the script is import networkx as nx from networkx.algorithms.approximation import clique G = ...
1
vote
1answer
108 views

Setting up init.d service daemon priority (with or without monit)

Does anyone know how to change the process priority with monit? I want a high one. Monit config file for my service so far: check process RPiQuadroServer pidfile /var/run/RPiQuadroServer.pid ...
5
votes
2answers
219 views

Portability of file descriptor links

I've always wondered this but never took the time to find out, so I'll do so now - how portable is the usage shown here of either /proc/$$/fd/$N or /dev/fd/$N? I understand POSIX guarantees /dev/null, ...
1
vote
1answer
129 views

How to trace system calls being invoked after typing command?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me ...
15
votes
2answers
833 views

What happens when we type a simple command on shell? [duplicate]

I have a simple doubt on execution of a simple command. As per my understanding, when we type a command such as ls on interactive shell, Shell interpretes the command. Shell creates a child process ...
6
votes
3answers
268 views

Understanding environmental variables in different contexts

Trying to understand the behaviour of the environment in Linux (Ubuntu 13.04 concretely), I've find different situations where setting envirionment variables are used or defined for/in different ...
2
votes
2answers
44 views

Limiting number of processes by name

is it possible to limit number of processes for a given group or user using the process name? Eg. I'd like to groups remotes have only 5 simultaneous ssh processes that are run on my server. I don't ...
4
votes
2answers
114 views

How to kill a process started as daemon?

I start a process using foo &. It outputs something like: [1] 16915 This is the process id, I guess. How can I store this number into a variable named MY_PROCESS_ID (for example)? Then I ...
0
votes
1answer
48 views

Script: Running a second process when the firts ended

I am trying to make a script that consist in a two parts. the first one is to run a initial state and the second one is to equilibrating the system. The problem is that the second is dependent of the ...
2
votes
1answer
67 views

Application lags if started from init.d?

I have a program (pre-compiled binary) that, when started manually on linux, runs fine. It has a CLI that I use to enter commands. This program is a software router, I can connect to it's CLI to ...
2
votes
2answers
155 views

Determine what java applications are running within the java process name

I am writing a Built System for Sublime Text 3 for JavaScript unit testing. I am using js-test-driver as my testing framework. Sublime Text can only execute one command, so I am using a bash script to ...
3
votes
2answers
110 views

Process in user mode switch to kernel mode. Then the process will have root privileges?

According to http://www.linfo.org/kernel_mode.html in paragraph 7: When a user process runs a portion of the kernel code via a system call, the process temporarily becomes a kernel process and is ...
3
votes
2answers
83 views

How to find out the reason a command/code was executed on Linux?

I have a complex embedded Linux software running on a gentoo derivative, on which a certain piece of code gets executed regularly every ~84 minutes. Sweeping through the main code to find places where ...
3
votes
1answer
48 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
2answers
45 views

What does it mean exactly when a processes “Time” has stopped in top?

I'll be looking into why we're getting critical swap alerts, and I'll find something like: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP COMMAND 14683 user1 30 10 16.0g 772m ...