Questions tagged [pid]

Process Identifier (PID)

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.

Source: wikipedia

108 questions
0
votes
2 answers

Using /dev/shm folder for pid files on RHEL6/CentOS6?

RHEL7/CentOS7 has a dedicated folder: $XDG_RUNTIME_DIR (e.g. /run/user/1000) for pid files, that folder is a tmpfs. However RHEL6/CentOS6 does not have $XDG_RUNTIME_DIR. RHEL6(also RHEL7) has a folder using similar type: /dev/shm. After some testing…
Boying
  • 103
  • 3
0
votes
1 answer

get process id of openvpn client in bash script

In a bash script I am starting openvpn as a client like this: #!/bin/bash conf_file=/etc/openvpn/blahblah.conf openvpn_pid_file="/var/run/openvpn-client/ovpnc.pid" command_line="/usr/bin/openvpn --config $conf_file…
MountainX
  • 701
  • 3
  • 12
  • 25
0
votes
2 answers

Saving PID as part of the filename of nohup's output file

I want to save the PID of a nohup process as part of the name of nohup's generated output file. This is going in the right direction, but only works if the process with it's ID is already settled, i.e. only works at the next line. That means that it…
colidyre
  • 137
  • 7
0
votes
1 answer

Kill an application knowing its name and command line arguments

If I run a single instance of an application I can kill it via "kill my_app_name" without having to find out what its PID is. But when I'm running multiple instances of the same application with different command line arguments, how can I kill it in…
Raj
  • 129
  • 1
  • 1
  • 6
0
votes
3 answers

Linux: how to detect death of a process?

I would like to detect that a certain process in linux have died. Say that pid of that process is 1234. I can check that its pid is in use by testing the existence of /proc/1234/. Still, it is possible that the process have died and pid was…
0
votes
1 answer

Different pid between NodeManager Managed Server and Java Process

On our Weblogic server, when the server goes OOM, the hprof file is generated with a pid java_pidA.hprof but there is another message from the Node Manager that says managed server ManagedServer_1 with pid pidB was shut down successfully. Why are…
Chinmoy
  • 101
  • 2
0
votes
1 answer

How to make logger log PID on CentOS7

i found documentation for logger stating one can use --id=$$ to log the pid of the calling script. unfortunatly this is not working with logger in centos7. what is the proper way of logging pid to syslog in centos7?
0
votes
1 answer

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 have found there is a listening process on port…
reustmd
  • 107
  • 1
  • 9
0
votes
1 answer

How can I get su screen PID on Debian8?

I want to run this command by another user (so with su): screen -ALmdS server_mta ./mta-server -n It's okay: su - server_2 -c 'screen -ALmdS server_mta ./mta-server -n But I need the PID of screen, but when i try to get, I got anoter PIDs. I tried…
0
votes
1 answer

How to identify if a process is unique vs a coincidental same PID?

Having the ability to identify a PID for a process, let's say HTTPD for example, how can I determine later on, on that same server, if that PID/Process is still the original one ? For instance, I could have an HTTPD process under PID 123. A few…
GPATA
  • 3
  • 1
0
votes
3 answers

Log pid than cpu higher than a value

I'm looking for a way to log the pid of process higher than a fixed value of cpu (ex 40%). I tried with command like this : ps -eo pcpu,pid,user,args | sort -k 1,2 -r | head -10 But, first, it sorts by the first column of the output, not by the…
VinceCore
  • 31
  • 4
0
votes
1 answer

Where to create an AF_LOCAL/AF_UNIX socket file when not allowed to write in /var/run?

FSH says that socket and pid files should go to /var/run However, for security purpose, only root can creates file and subdirectories in this location. A common solution is creating a subdirectory for the script in /var/run and ten chmod it... But…
hl037_
  • 267
  • 2
  • 10
0
votes
1 answer

Restarting shell script with &disown using Monit

I have a shell script that runs a C++ backend mail system (PluginHandler). I need to monitor this process in Monit and restart it if it fails. The script: export LD_LIBRARY_PATH=/usr/local/lib/:/CONFIDENTAL/CONFIDENTAL/Common/ cd…
0
votes
1 answer

Weird stuff in server error log?

I have a PHP script that shuts down server processes based on their PIDs. It seems like it works well, however, I found this weird stuff in Apache's error log. Any idea on what it's saying? [Thu Jul 24 10:27:09.609608 2014] [mpm_prefork:notice] [pid…
S17514
  • 1
  • 1
0
votes
1 answer

sh bash script ambiguous redirect pid of file using single quotes

I have the following new line in my .sh file su --session-command='$javaCommandLine & >>$serviceLogFile 2>&1 & echo \$! >$pidFile' $serviceUser || return 1 When I had it with double quotes it somewhat worked but the pidFile had the wrong pid it was…
SSpoke
  • 161
  • 2
  • 10