Questions tagged [pid]

Use this tag for questions about Process ID. For questions about PID-controllers, use [pid-controller] instead.

In computing, the process identifier (normally referred to as the process ID or just PID) is a number used by most operating system kernels (such as that of UNIX, Mac OS X or Microsoft Windows) to (temporarily) uniquely identify a process. This number may be used as a parameter in various function calls allowing processes to be manipulated, such as adjusting the process's priority or killing it altogether.

If your question is about Proportional Integral Derivative control, please use instead.

1697 questions
0
votes
1 answer

maximum number of processes and maximum PID value

Referring to this question maximum-number-of-processes-in-linux I under stand that kernel.pid_max affects the maximum value for PID and max user processes in /etc/security/limits.conf file affects total number of processes for each user. so if this…
Mahmoud Emam
  • 1,499
  • 4
  • 20
  • 37
0
votes
2 answers

How can I identify a progam by pid

My title is more than no explicite so feel free to change it (don't really know how to name it) I use a php script to check if a list of pid is running, My issue is that pid identifying is not enough and some other program can get the pid number…
eephyne
  • 911
  • 9
  • 15
0
votes
1 answer

What is the diff. between getpid and gettid in c++

getpid() vs gettid() Please tell me the diff. between getpid and gettid.
vijayraj34
  • 2,135
  • 26
  • 27
0
votes
1 answer

Send child pid using sigqueue and SIGUSR1 to father

I am trying to send a child's pid to his father using SIGUSR1 and sigqueue. But the signal is never sent, or it appears not to be sent. #include #include #include #include #include void…
Tanatos Daniel
  • 558
  • 2
  • 9
  • 27
0
votes
2 answers

Get pid from exec() in php

I need to exec a script using exec() and get the pid back. $pid = exec("./runtunnel $remoteip $remoteport $localport");
math.random
  • 99
  • 2
  • 10
0
votes
1 answer

Send Ctrl+C to a proccess started within java

I want to be able to kill a ping started from my java program, but I need to get the pid to do so. I also did some research and I found out that I can use SendSignal.exe to send Ctl+C, but I need the pid of the process that I have just started. Is…
Ducksauce88
  • 640
  • 3
  • 12
  • 26
0
votes
1 answer

Fail to read command output using popen function

In Linux, I am finding pid of process by opening pipe with "pidof process_name" command and then reading it's output using fgets function. But it fails to find pid once in a while. Below is my code for finding pid of my process. int…
ravibhuva9955
  • 199
  • 1
  • 11
0
votes
1 answer

How come pid files are used when pids can clash with an unrelated process?

It seems that a common way of running only one copy of a process is to write a pid to a file and then on start check whether a process with that pid exists. I imagine OS is trying not to reuse a pid quickly after a process has crashed, but since the…
Bob
  • 65
  • 8
0
votes
0 answers

How to fix Ubuntu 14.04 Apache PID not match?

Lately, every time I restart the server, Ubuntu always gives me a warning message of Apache 2 PID not match. I have to manually kill it and restart Apache 2. I then follow the guide to check if the PID file in /var/run/apache2 is same as the one in…
KKyang
  • 45
  • 11
0
votes
1 answer

Explanation about multiple su

I'm a bit confused when a multiple su happen. Lets say a situation like this happen: Fikrie su to root : ps -ef | grep su: root 15524 15388 0 10:15 pts/0 00:00:00 su root I know that the pid for that su is 15524 and the parent pid is…
Mohd Fikrie
  • 197
  • 4
  • 21
0
votes
3 answers

best way to get the result of `$?` for telnet connections

I want to telnet some ips and I want to get the result of $? immediately: SO I tried: while read ip; do telnet $ip 1>/dev/null 2>&1 pkill $! if [ "$?" -eq "1" ]; then echo $ip >> host-ok fi done < file But this is not a good…
MLSC
  • 5,872
  • 8
  • 55
  • 89
0
votes
0 answers

Process ID is always 0 in linux, Is it valid?

My program finds the pid in Linux. But it’s always returning 0. Is it supposed to be like this? I used gcc. Is it valid? When will I get process IDs without 0? Here is my code. #include #include #include #include…
Hasib Hasan
  • 93
  • 1
  • 2
  • 10
0
votes
1 answer

python vte: get the pid of the fork process

I'm using a vte term to run a bash script self.child_pid = self.v.fork_command(None, ['/bin/bash', 'dPluzz-cli', dest, '-u', adresse]) How can I do to get the number of the pid ? I tried os.getpid() but the pid is the number of my python…
Guillaume
  • 2,752
  • 5
  • 27
  • 42
0
votes
0 answers

Convert `pid_t` into `char*` in Linux environment

I have a function called writeToMemory(char*) and all it does it writes the char* argument to the memory. I want to write the current process ID to the memory. I tried the following: char newPID[30] = {0}; sprintf(newPID, "%d", (int) getpid()); but…
Billie
  • 8,938
  • 12
  • 37
  • 67
0
votes
1 answer

Sequential and contextual process identifier

I have a CLI application of which I can run multiple instances simultaneously. I need to associate a unique, sequential and re-usable identifier to each instance. It should also be contextual/independent for each process type. Example: The first,…
Tiago Alves
  • 1,301
  • 2
  • 18
  • 30
1 2 3
99
100