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

learn more… | top users | synonyms (1)

5
votes
2answers
102 views

Why process does not (seem to) exist before fifo read

I have a trivial Python script: #!/usr/bin/python import os, sys sys.stderr.write('I am %s' % os.getpid()) sys.stderr.flush() print "hello" sys.stderr.write('I am done') When I run this script ...
2
votes
3answers
455 views

bash - get pid for a script using the script filename

I have two scripts: running_script script_one I need to get the PID for the/any instances of running_script running under a username, and then pkill to stop the running_script and daughter ...
2
votes
1answer
55 views

how to get processor that thread is currently assigned to?

I've found such column in ps -elF: PSR processor that process is currently assigned to. I need something similar but for threads. ps huH p 1234 prints threads of process 1234, can I somehow add ...
3
votes
3answers
103 views

How to get the pid to the last background app

Following from this question: How to get the pid of the last executed command in shell script? The thread there is good and clear, but what if the command actually doesn't require a '&' at the ...
2
votes
2answers
82 views

How to get information about files being copied to my machine by remote rsync command?

I am rsyncing a directory from machine B to machine A. rsync command is run on machine B. On machine A, what kind of information can I get about this rsync process (progress/amount of data downloaded ...
2
votes
3answers
81 views

How to make init script print “OK” only when all subprocesses are stopped?

I have a very complex python application. It has it's own init script, but when I execute: sudo service my_service_daemon stop It prints "Stopping my_service_daemon [OK]", but in real ...
1
vote
2answers
59 views

How to monitor the output as the process runs on a RedHat Linux server?

You need to run a process on a RedHat Linux server that takes a little while to run. You want to monitor the output as the process runs but need to guarantee that the process won't terminate if you ...
2
votes
1answer
44 views

Strange behavior of 'ps -o pgid'

Intro: I have a daemon, which spawn processes and I have to stop it all gracefully. The solution I found on web based on pgid: group_id=$(ps -o pgid= $(cat $pidfile)) if [ ! -z $group_id ]; then ...
1
vote
1answer
74 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 ...
1
vote
1answer
257 views

How to get UID and PID

So here's what I want to do: User inputs a USERNAME. Based on this username, I need to get the list of processes started by this user. I am planning to do this by getting the UID of this user and ...
1
vote
0answers
66 views

CentOS Running process not responding to kill signals and not context switched

An updatedb process on my linux server is not responding to kill signals. (kill -9 or SIGSTOP) [root@chroot-1 ~]# ps auwx | grep -i 4505 root 4505 99.5 0.0 59544 1256 ? RN 09:43 ...
5
votes
1answer
99 views

PID in arch-chroot is incorrect

I am trying to run a python script in a chroot (specifically, the chroot is created with arch-chroot). The python script relies on os.getpid(), but this seems to be returning an incorrect PID within ...
1
vote
1answer
137 views

pid file error when starting stunnel

I'm trying to start stunnel at my mac os as client. But I'm not able to get it running as I have noticed this reported problem at the stunnel's log file: 2015.10.10 16:10:24 LOG5[ui]: stunnel 5.23 on ...
2
votes
2answers
332 views

linux equivalent to AIX proctree command to show all child and parent processes of a given PID

Sometimes I'm looking for an equivalent for the AIX proctree command which displays all children and all ancestors of a specified PID and can be sometimes quite useful for troubleshooting purposes. As ...
1
vote
2answers
87 views

Which user is running the most processes?

My top looks like this: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 6524 asjzdiwq 30 10 500m 41m 24m S 0.0 0.3 0:15.27 php-cgi 21274 asjzdiwq 30 ...
1
vote
2answers
414 views

How to find PID of a while loop?

I run this command in Bash terminal while [ 0 ]; do i=1; echo $i; done Before running this loop, in another tab of gnome-terminal I did $ps aux | wc -l 192 While the loop is still ...
1
vote
1answer
139 views

pkill with regex

I have few java processes running like below, java -jar /my/path/to/app/myapp.jar java -jar /my/path/to/app/prodapp.jar java -jar /my/path/to/app/testapp.jar java -jar ...
2
votes
1answer
274 views

Why does a “child” process finish before its parent?

This is the code example given: # include <stdio.h> # include <unistd.h> void main() { static char *mesg[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; int display(char ...
3
votes
3answers
514 views

How to create a process tree?

I have some code that kills processes and their children/grandchildren. I want to test this code. Currently I'm doing $ watch date > date.txt, which creates a process with a child. Is there any ...
7
votes
3answers
184 views

How to view summaric memory usage of groups of commands (instead of processes)

Is there a way to group similar processes when using tools like top/htop? Sometimes I just want to know whats eating my memory and some programs (browsers mostly) are using multiple processes, which ...
1
vote
0answers
33 views

Cannot terminate for loop in terminal

I was running a for loop in terminal which has a sox command in it. For some reason the sox command failed and now I cannot terminate the for loop. I tried pressing Ctrl+c many times, Ctrl+z many ...
5
votes
3answers
475 views

Show network connections of a process

There is a way to show the connections of a process? Something like that: show PID in which show is a command to do this, and PID is the pid of the process. The output that I want is composed by ...
1
vote
4answers
1k views

Disabling column names in ps output

How to format output of ps -p command? To not show me something like this: PID TTY TIME CMD but just PIDs. I'm using Linux.
1
vote
0answers
20 views

How to stop a program that is not showing up using monit?

I have a set of raspberry running raspbian. On each of these, I have configured monit to monitor the epiphany browser, which should always show up with a specific web site. Unfortunatly, some times ...
1
vote
2answers
174 views

Shell's process group ID = foreground job's process group ID?

I decisively conclude that Shell's process group ID = foreground job process group ID from the 2 sources below. When a background job is selected to run in the foreground, is it the shell's process ...
2
votes
3answers
81 views

Processes group (session) of GUI processes

According to what I know, the shell and its child processes are in the same session which have the same (controlling) terminal. I read that they are interactive processes because they have the same ...
1
vote
0answers
12 views

Definitions arguments of daemon and server

Somehow, I feel clear about definitions of daemon and server after learn a little bit about X11. So, I would like to have verification to my definitions as below. Daemon is a process that is not ...
1
vote
1answer
69 views

How do I get the pid of the exact progarm launched

So I have a couple python programs say program A and program B, when using "pgrep python" to get the pid, it gives me the pid of both program A and program B. However, I am writing a program that need ...
2
votes
2answers
144 views

When does a process terminate in UNIX?

At which moment a process in Unix is terminated? Is it necessary a command such as exit(0) or return 0 to be written in a program to terminate a process? My question is provoked by the following code: ...
2
votes
1answer
58 views

Add fixed PID value to the process

I need to set PID number of my process to fixed value, because I need to kill it with my application when some conditions are met, is it possible to do that?
1
vote
1answer
107 views

Unable to kill process, even with root. How to diagnose?

There are a lot of bash processes running on my Ubuntu Linux (12.04). Even when I close the terminal they are still shown in the System Monitor. I tried killing them as below, but they remain as it ...
4
votes
1answer
96 views

Why does a process of a binary with only execute permission remain hidden in “ps” when using hidepid=2, if the user is not root?

I'm using hidepid=2 to mount /proc, so users can't see any but their own processes. A particular binary I want to use has been restricted to rwx--x--x permissions, so only its owner (root) can read it ...
1
vote
0answers
48 views

Threads vs. Processes [closed]

What is more recommended when developing an application, which for example has to do: receive characters from UART port, parsing GSM data, website update. Is it better to distribute/split tasks to a ...
1
vote
2answers
153 views

How to start the killed java process with its PID?

How to start the killed java process with its PID in Linux?
2
votes
1answer
46 views

What is the difference between opening an application from terminal Vs directly opening it?

I could open Firefox browser either by clicking FF icon on desktop or by running ~/firefox/firefox & in the terminal. What are the differences in these two ways of running? I am wondering because ...
15
votes
1answer
2k views

Why is the maximum PID in a 64-bit Linux system 2^22?

Why not 2^62, or 2^31 or anything else? What is the maximum value of the PID of a process?
0
votes
0answers
84 views

Per-process monitoring in cacti

I've read in some question that you are performing a per-process cpu/memory monitoring with cacti. Could you point a how-to I can use to get the same? Many thanks in advance.
2
votes
3answers
149 views

How to find out the process(es) that forks a lot?

Recently I got an load-too-high issue on our server. I watched top for like half an hour to find out that it was Nagios that forked a lot of short-lived processes. After bouncing Nagios, everything ...
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 ...
1
vote
3answers
61 views

Strange behavior with bg command

How to send process (application) to background if it always expects input on terminal and sending received data from uart to stdout all the time? I cannot send my app to background with CTRL+Z & ...
1
vote
1answer
66 views

How to run command in foreground then send to background

I need to run my application in foreground of linux terminal, send some commands to my program and then send program to background. I'm not really sure how to do that?
1
vote
1answer
45 views

List of killed apps

Is there a command to list latest killed processes? Or to search through log file for killed app, for example called "my_app"?
1
vote
3answers
209 views

Set Parent Process ID from ShellScript, kill all Child Processes later

I want to write a shell script for my Ubuntu machine, that starts a few server applications. I need this script in order to execute it from my java application. But I need an easy way to group all ...
1
vote
1answer
127 views

Figure out the PID of exact node.js application

Here is an output of my ps aux: ps aux | grep "node" root 2501 0.0 3.4 720400 68512 ? Sl 16:09 0:03 node /etc/skbx/host/skbx.js 8081 tula13 8082 8084 8085 10.8.0.6 root 20586 ...
2
votes
0answers
54 views

When waiting on a pagefault, in what kind of sleep is a task?

Are tasks put into interruptible/uninterruptible/killable sleep when waiting on a pagefault? Does it matter, what kind of pagefault is it?
0
votes
1answer
81 views

Haveged service won't run (dead pid)

So my system entropy is low on my centos 6 VM. (137) and I installed haveged, Yum install haveged But when I go to start the process it instantly dies: Process is dead but sub system is locked ...
3
votes
2answers
393 views

Finding Process Info Associated to a Given Port in HP-UX

I need to find information for a process that's using a given port number, such as 8080. More specifically, I'm interested in finding out the full path of the program. How can I do that in HP-UX?
0
votes
1answer
250 views

nginx stop is not working and nginx is creating new process after killing processes

nginx version: nginx/1.8.0 I am trying to stop nginx with the following command /etc/init.d/nginx stop, however it is not returning any successful message. Then I tried to view the nginx processes ...
0
votes
0answers
19 views

most minimum processes required to have Linux that functions properly [duplicate]

If I want to have Linux that functions properly for a user, are the most minimum processes required are init/systemd, terminal emulator and shell?
1
vote
1answer
50 views

My compiled program is being run via init.d but eventually gets killed

I made a small utility application in C that monitors udev for power events and adjusts my laptop backlight brightness automatically. (I'm running Ubuntu 15.04) I ran the following commands and it ...