Questions tagged [pid]

PID (Process IDentifier) is the number that identifies a process running on an operational system.

Filter by
Sorted by
Tagged with
9 votes
3 answers
16k views

Is a process PID guaranteed to stay the same as long as the process doesn't die?

I'm doing some simulation work with Linux, and the code I'm working on right now only works under the assumption that, once a process has been assigned a PID by the kernel, that PID will remain the ...
1 vote
1 answer
2k views

No need for export when running functions in subshell

I have a msource.sh script that will be sourced: $ cat msource.sh #!/usr/bin/env sh echo "($BASHPID) - sourced ${BASH_SOURCE[0]}" &>> "$logfile" # logfile is defined by the sourcing ...
1 vote
1 answer
985 views

bash trap in background functions

Calling a function in a script in background - using '&', the function is called in a subshell. When the function ends, the subshell ends, with an exit status. I would like to trap the exit signal ...
16 votes
2 answers
11k views

Is /var/run/user/$UID the new /var/run for PID files?

I have an application (running as a service as root) that creates a PID file under /var/run. But I'm wondering whether this is now no longer best practice. In Linux - alternative places where to ...
0 votes
2 answers
1k views

Where the process of the service?

At UBUNTU, service postgresql status lists Process: 18534 ExecStart=/bin/true (code=exited, status=0/SUCCESS) Main PID: 18534 (code=exited, status=0/SUCCESS) but when I test sudo ps -ax | grep ...
2 votes
1 answer
4k views

How Windows/Linux assign PID to processes?

Q1 : I want to know how Windows/Linux assign a PID to a process when that process began? Is it a delimited random number? or it is fixed for a file on a compute? does it have a special algorithm? and ....
1 vote
1 answer
2k views

How do I locate the PID code for an ASUS laptop webcam?

I can't look in the Device Manager for the PID code because the camera has disappeared from the device list. The driver still shows up in programs list, but the camera doesn't work. Where else can I ...
0 votes
1 answer
970 views

hide pid when a process is launched in background

So I put this command vncconfig -iconic &, this causes vncconfig window to launch and terminal will display like [1] 13488. I want to hide this pid info. That is, when we put the command, only ...
2 votes
1 answer
183 views

Init script changes for MongoDB

We have MongoDB (Version 3.0) in production in standalone as well as in cluster mode. Currently we were facing issue that basically states: Unclean shutdown detected hence unable to start mongod. ...
2 votes
2 answers
3k views

What causes a process to restart every time I force quit it?

So I think I've removed hamachi from startup. Done. Dusted. When after a restart a load up a server for a friend to connect. Then noticed he could connect without starting up hamachi. Hmm. Curious. I ...
-3 votes
3 answers
961 views

why is my processes in task manager showing ports like 100028,103904 etc ? I know only 65535 are possible in any windows system

I am on W10 x64. This is unusual . I haven't seen port number that high .I know only 65535 are possible in any windows system. it is happening from today ( I have rebooted several times). Is it ...
0 votes
0 answers
99 views

How can I find the PID for software where the name of the software is different from the executable?

I run "Videos" software from the Dash in Ubuntu. After some minutes the software freezes. I've tried searching for the PID of the software to kill it, but I can't find any result with these commands: ...
1 vote
1 answer
942 views

why is PID 0 reading/writing large amounts of data

Just booted my PC up and it was running slower than usual. I went into the resource monitor and its saying that System PID 0 is reading and writing 100,000,000B/sec and its accessing all drives for 50%...
22 votes
6 answers
74k views

How to get the pid of a running process using a single command that parse the output of ps?

I am looking for a single line that does return the pid of a running process. Currently I have: ps -A -o pid,cmd|grep xxx|head -n 1 And this returns the fist pid, command. I need only the first ...
3 votes
2 answers
631 views

Windows 7 - missing PID in services tab, task manager

So, as stated in the title, PID tab is missing from services tab in task manager. I need PID in order to find a windows service, which causes lots of hard page faults in my system. Any way to fix that?...
0 votes
1 answer
773 views

PID of commands run as different user

While being a root, I want to start a service as a specific user and write its PID file. Minimal nonworking example: if [ $UID -eq 0 ]; then su myuser <<EOF sleep 30 & echo $! >...
1 vote
1 answer
1k views

Windows 7 PID consumes 50% CPU almost everyday for hours [duplicate]

I'm trying to determine why these services consume 50% of my CPU for hours at a time each day. I cannot restart the services without error and killing the PID just restarts it in a few minutes and it'...
3 votes
2 answers
2k views

Open file in Notepad++ as a tab without closing launched process

Some old tools are designed to work with an external text editor. I am stuck using a legacy tool that does this in the following way: Create a temporary file with the content to be edited. Launch the ...
0 votes
0 answers
1k views

how do I get the PID list and USERNAME of each of those PIDs in LINUX using python?

I am trying to get the PID's and their respective usernames for displaying something similar to the top command in linux. I managed to get the list of PIDs but I am unable to fetch any username for ...
1 vote
2 answers
335 views

Kill all tasks with PID above a certain integer with bash

How may I fetch and kill all processes with a PID above e.g 1000? Using commands like ps -A and top is fine for viewing the list of processes, but how would one only get the PIDs? The logic of ...
0 votes
0 answers
850 views

How do I figure out a root cause of a zombie process?

A process on a production linux server became a zombie with unknown reason. I wonder if there is a certain methodology to find out what causes it.
0 votes
0 answers
150 views

bash: monitoring which files are used by a process in real time

Is there any command to track what files are opened / closed / written by program with given PID in real time? I want to: run a program, enable program file operations monitoring, do some stuff in ...
8 votes
1 answer
14k views

How do I determine the PID of my python program if there is more then one python program running?

I have two python programs running on my system, say they are called program x and program y. I want to get the pid of program y, but not x for my bash script. When using pgrep python, I get the pid ...
20 votes
2 answers
8k views

Does Windows 7 reuse process IDs?

Does Windows 7 reuse process IDs? The reason I ask this question is due to my experience that Windows XP and Linux never seems to generate process IDs higher than 20–30k. However, my Windows 7 ...
3 votes
5 answers
17k views

How to find process pid of an application

I have portable version of an app. I have ran for example 5 multiple instances of it and they all have the same process name but different pids. I want to find a way to for example kill one specific ...
1 vote
1 answer
790 views

PID of background task is different to the listed task PID using ps

Note: I h ave moved this to stack-overflow, I think that is the right place: here I have a strange issue, I can't quite get my head around. What I do is run a function called fn_rundumper which ...
0 votes
0 answers
88 views

Process ID files missing from remote Ubuntu Linux PC?

I am running Ubuntu 12.0.4 LTS on a PC in my office and on a virtual machine hosted on Azure. For some reason, the remote PC is not creating a PID file for each process. Everything else seems to ...
1 vote
1 answer
2k views

The server quit without updating PID file

I am trying to install MySQL on my Mac w/ Mavericks OS. Whenever I try sudo /usr/local/mysql/support-files/mysql.server start it shows an error The server quit without updating PID file (/usr/local/...
0 votes
2 answers
688 views

How to view the calling script on Linux [closed]

I am trying to write a script to help with computer security. I am trying to look for open ports, find the PID, and find what called it. I have it working, where my output looks something like this: ...
3 votes
1 answer
6k views

How to start a process with a predefined (in case it is unused) PID?

Is it possible to start/run a process with a predefined PID? In Linux or in OS X (or BSD)?
0 votes
1 answer
127 views

How to execute a script 20 at a time with different variables at a time in parallel?

I am trying to run 20 files at a time, using warc.sh or a better way to put it is 20 instances of warc.sh at a time with directory contents as the input. I am also trying to watch the PIDs in case bad ...
1 vote
1 answer
767 views

Shell, subshell, source, background process, PID == confusion

I am trying to get my mind straight as to how all these things are put together. For example with this script: #!/bin/bash . script1 ./script2 . script3 & ./script4 & sleep 5 How do the ...
2 votes
0 answers
873 views

Install perl module from rpm file

I have a perl issue and obviously I'm not a perl expert. I can not use CPAN. I've installed File::Pid using a rpm, or I tried. I downloaded perl-File-Pid-1.01-3.el5.noarch.rpm (and the perl-Class-...
0 votes
2 answers
1k views

Getting pid of process not listed in ps -ef

I know there is a process called blt.pl running on a particular machine but not quite sure which user is running it. i have tried ps -ef | grep -i blt.pl but obviously it's not finding it. Is there ...
11 votes
1 answer
14k views

Where can I find my (current shell process') PID?

I'm on OS X using ZSH (have lots of homebrew stuff, too). I'd like to know the PID of my current terminal. (I'm learning more about process management on *nix systems, pstree and the like, and so ...
1 vote
1 answer
1k views

Weird start-stop-daemon behaviour?

I have the following script: #!/usr/bin/python3 import sys for s in sys.argv: print(s) Now I execute: sudo start-stop-daemon --start --pidfile /var/run/test.pid --make-pidfile /var/run/test....
0 votes
0 answers
4k views

Squid Proxy process not running

Hey community, some days ago my squid crashed. I'm running squid 2.6 STABLE21 on CentOS. The output of the "show squid status" command is just squid dead but pid file exists starting the ...
1 vote
1 answer
240 views

Red5 on Debian, output PID

I'm fumbling my way through with this one, as a novice with all things linux so please be patient :) I would like to output the process ID of a program to a file. From my readings this is generally ...
5 votes
2 answers
5k views

Show PID of process just launched in ZSH

Can I show the PID of a process that I just launched, ideally at the end of the line of the command? Example: root in ~: mysqld .................. [PID 34567] 12121 mysql-logs start to come in... ...
0 votes
0 answers
612 views

Is there a process with pid 0 linux? [duplicate]

Is there a process with pid 0 linux? Also is there any negative pids? This is just out of curiosity :D
2 votes
1 answer
2k views

Determine display or VNC session based on PID

I frequently VNC into a server where we run many concurrent computationally intensive matlab processes. Sometimes, one of my processes misbehave, which I can see from top, but I have a hard time ...
1 vote
1 answer
557 views

Reattaching to screen - Linux

We run several screen instances from one box, eg. : 27185.pts-53.CentOS-57-64-minimal (Detached) 27209.pts-53.CentOS-57-64-minimal (Detached) 27281.pts-53.CentOS-57-64-minimal (Detached)...
0 votes
2 answers
2k views

How can I stop jenkins.pid in fedora15?

I have jenkins running, but I need to stop it. in /var/run I have jenkins.pid which is what the standard jenkins script uses to stop jenkins. The jenkins script uses start-stop-daemon which doesn't ...
2 votes
0 answers
551 views

Routing packets to different available networks using process' pid / uid

I need to route packets from some processes(unique pids/uids) to desired network connection. So, Suppose we have 4 processes with pids 10, 11, 12, 13 respectively; and we have two network connections ...
4 votes
1 answer
2k views

Windows analog of $1 (PID of the last started process)

How to get on Windows PID of the last started process using WScript.Shell or similar? I know how to start a process and get its PID: Set oExec = WshShell.Exec( program ) Set pid = oExec.ProcessID ...
3 votes
1 answer
11k views

Blink/Flash Text -Shell Script

I have a bash script where I'm zipping some files. This process sometimes takes time depending on the file sizes. I want to get the pid of this command and display a flashing message "Zipping..." ...
1 vote
1 answer
600 views

How to identify the process which has loaded a certain file

I have certain file in the disk which I am unable to delete, as it mentions that it's being used by a certain process. How do I identify the process which is using this file?
8 votes
1 answer
14k views

After forced quit, “killall Finder” says “No matching processes…” but PID still exists?

Here's one for ya. Upon a forced quit of the Finder with unsuccessful relaunch, "killall Finder" in terminal returns: "No matching processes belonging to you were found" Oddly enough, the PID for ...
3 votes
4 answers
3k views

Loop: Start program and kill after time out

for debugging reasons I want to spot one of those bugs showing up just occasionally. Therefore I want to code a while loop in the shell starting the program (if it will segfault => that's what I want)...
0 votes
3 answers
2k views

How can I check the PID of a X-server in another virtual terminal?

I am trying to open a program in a naked X-server on a different virtual terminal. I am using ubuntu 9.10. The command I'm using is this. openvt -f -s -- `X :2 & '/path/to/program' -display :2`; ...