Process Identifier (PID)

learn more… | top users | synonyms

10
votes
5answers
26k views

The PID of a bash child proccess (imapsync) - how do you get it?

Can any one tell me how to get the PID of a command executed in bash. E.g. I have a bash script that runs imapsync. When the script is killed the imapsync process does not always get killed, so I'd ...
15
votes
5answers
29k views

How to get pid of just started process

I want to start process (eg. myCommand) and get its pid (to allow to kill it later). I tried ps and filter by name, but I can not distinguish process by names myCommand ps ux | awk ...
0
votes
1answer
78 views

Do something with Apache's root PID before it forks

I need to set a property on the root Apache process which in inherited by its children (e.g. oom_adj, cgroup membership). However, Apache will fork itself as soon as it starts. Using $$ in the ...
8
votes
1answer
15k views

Init script does not create a PID file

I need to create an init script for an IRC logger. I copied /etc/init.d/skeleton. I filled in the configuration section to fit my needs and I also had to add --background to the start daemon command ...
25
votes
5answers
26k views

what permission to write PID file in /var/run

Ubuntu touch: cannot touch `/var/run/test.pid': Permission denied I am starting start-stop-daemon and like to write the PID file in /var/run start-stop-daemon is run as my-program-user /var/run ...
5
votes
2answers
6k views

Can start-stop-daemon use environmental variables?

I need to daemonize a Windows app running in Wine, and create a pid in /var/run. Since it requires an X11 session to run, I need to make sure the $DISPLAY variable is set in the running user's ...
1
vote
3answers
2k views

Identify PID of a transient network connection on HP-UX 11.23

We've tried lsof and tcpdump to capture the PID of a process that is attempting to make connections. Any ideas?
8
votes
5answers
5k views

Are .pid files reliable for determining whether a process is running?

Many programs such as sshd create .pid files in /var/run/ that contain their process ID. Are these files reliable for determining whether a process is running? My guess is that these files are ...
0
votes
1answer
541 views

How can I force a refresh of what ports have listeners

I'm trying to re-launch a WCF service that I killed earlier, but I'm getting an AddressAlreadyInUseException. The port it's attempting to use is 1819. I ran netstat -nao from the command line, and ...
0
votes
2answers
286 views

Given pid, find the long gone process

I know that a certain process is restarting my web server at a certain time (probably in a cron job? It doesn't happen every day, though) but I don't know which process, only it's id (from looking at ...
14
votes
2answers
8k views

Directory in /var/run gets deleted after hard reboot

I keep my sphinx pid in /var/run/sphinx/searchd.pid but every time I hard reboot the directory /var/run/sphinx disappears and sphinx fails to start. Is there a way to make that directory stick or ...
1
vote
2answers
762 views

Where is the apache pid file on Gentoo?

I need it to configure Monit, but the path in the sample config file is /usr/local/apache/logs/httpd.pid and it's not there. It's also not anywhere in /etc (at least not with that name).
4
votes
2answers
4k views

Possible to send kill signal to all processes with a given ppid?

I have found myself having to regularly send kill -STOP one million processes, but they all come from the same parent. Is there a smarter way to do this?
4
votes
7answers
24k views

Port 80 is being used by SYSTEM (PID 4), what is that?

I am trying to use port 80 for my application server, but when I perform "netstat -aon" I get TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 When I look up the process in ...
5
votes
5answers
5k views

how to get process file name from PID in MacOS?

Is it possible to get a file name of a process using PID? ps displays a lot of useful information about a process, but not a hint about a process executable file location.