Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pid]

Process Identifier (PID)

0
votes
1answer
33 views

Kill ssh process

I was connected to an ubuntu machine and instead of typing exit to logout, I killed the ssh process by its PID: kill PID Now, when I try to connect again to the ubuntu machine, I get the following ...
0
votes
2answers
68 views

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 ...
0
votes
1answer
149 views

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 --...
0
votes
1answer
103 views

Saving PID in nohup output

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....
1
vote
2answers
38 views

How to find the port used by sshd for a port bind without sudo?

To remove a given port bind the pid can be found with sudo netstat -lnpt and then removed with kill pid. As the process name is known (sshd) the non sudoer user who started it may found the pid with : ...
0
votes
0answers
76 views

Php-fpm from php.earh repos over Alpine Linux VM: Unable to create the PID file

I have installed php-fpm7.2 from php.earth repositories by following the instructions and running the command: sudo apk add php7 php7-fpm Then when I launch the php-fpm directly as: sudo php-fpm I ...
-1
votes
1answer
43 views

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 ...
0
votes
3answers
2k views

Linux: how to detect death of a process? [closed]

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 ...
1
vote
2answers
870 views

How do I get the PID of a conhost process associated with the batch file and cmd process that created it?

Say I have several conhost processes that happen to be running already. Now I run a batch file, which starts a cmd process which, in turn, causes another conhost process to open up. From within the ...
0
votes
1answer
1k views

Why is /run/nginx.pid disappearing? simply disappears from the system everyday?

IMPORTANT NOTE: I no longer need to restart the servers(my 3 VPS!) to have the pid file back in the dir /run/nginx.pid I just typed the command: sudo fuser -k 443 / tcp && service nginx start ...
1
vote
1answer
188 views

tcpdump - how to track the source of requests made with ephemeral/dynamic ports

I'm trying to identify the network traffic between multiple backend microservices running on the same server. (they make some rest http calls to each other) Unfortunately, when i use tcpdump, the ...
1
vote
1answer
137 views

How to get last PID when last process spawned a child and exited?

I start ssh -S mysocket example.com to connect example.com. If my connection hangs, I need to kill that process: ssh -S mysocket example.com -N -L 1234:localhost:1234 & last_pid=$! ...(do ...
1
vote
2answers
2k views

Getting PID from lsof list

I have a react-native application and I want to write a script for start test version. I need to shotdown the :8081 port if it is alive. The command: lsof -i :8081 kill -9 <PID> The lsof ...
0
votes
1answer
90 views

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 ...
0
votes
1answer
256 views

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 ...
1
vote
1answer
268 views

Kill (close) reliability monitor windows by PID powershell

I am trying create a process of the windows reliability monitor and kill it after I take a screenshot. I am having trouble to get the process and automatically close it before I take the screenshot ...
5
votes
2answers
8k views

Systemd drop-in fails to create PID file

I have a drop-in for systemd-machined at the path /etc/systemd/system/systemd-machined.service.d/10-machined-pid-file.conf. when I run systemctl status systemd-machined I do see the lines Drop-In: /...
0
votes
1answer
48 views

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, ...
1
vote
1answer
709 views

Process changes its PID every second

Today I saw that one process (.NET Runtime Service - mscorsvw.exe) changes its PID really often. When Task Manager refreshes the PID of that process, it is always different. Is that normal? An ...
0
votes
1answer
253 views

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 ...
1
vote
2answers
983 views

systemd, logrotate and PID-files

I'm packaging some daemon for debian 8 and systemd. The daemon can create PID-file by itself, but it has no permissions to write into /run because of non-root user. It used to create PID-file via old ...
1
vote
1answer
502 views

zombie lxc swap file: text file busy but no pid

I have a server running Ubuntu 12.04.5 LTS (Precise Pangolin). On that server I created a new Linux container: $ sudo lxc-create -n mycontainer After a while I decided to get rid of this container: ...
4
votes
2answers
5k views

How properly handle deletion of pid.file in service script

I'm trying to write service script for application. So I can control it like this: ./myscript.sh start|stop|status On startup pid.file with process id creates, and based on it I can check status and ...
-1
votes
1answer
782 views

pidof service doesn't exist

I am trying to set init.d script for some service - let it be uptime that is located in /usr/bin/uptime. Here is my script: #!/bin/bash # description: read service #Source function library . /etc/rc....
2
votes
2answers
307 views

Clustered cron with one server only overlap allowed

I've setuped load balancers: lb1 (active) and lb2 (passive), Glustered web servers: web1 (active), web2 (backup), and some clustered database. Both web servers and databases are A pointed to the VIP ...
-2
votes
1answer
641 views

How to run a program in a new PID namespace

How to run a program in a new PID namespace? All tutorials on the internet show writing some custom C code in order to do it. Is there a command instead for that?
2
votes
3answers
5k views

Apache Failure on Centos 7 not starting

hellau everyone, i have a problem, that i cant resolve alone, so i need your help. i have installed on a centos 7 apache when im asking for the status of the service (systemctl status httpd) so i ...
1
vote
1answer
936 views

RamMap shows millions of processes that Task manager doesn't

I have a server 2008 box with 32GB RAM on and i have been investigating why it runs out of memory every 150 ish days. Task manager shows that we are running at 99% memory usage but all the processes ...
2
votes
0answers
33 views

When is a pid needed in log rotation?

I've read that providing pid in the newsyslog.conf is to ensure that the process writes in the new log file. However, I've tried log rotation without providing a pid because I couldn't find one for ...
2
votes
1answer
178 views

Ubuntu: Postfix and Cyrus expecting saslauthd PID file in different locations

I'm running postfix and cyrus in parallel on my server, as far as I understand this is a quite common think to do. Both daemons use sasl authorization. However, postfix is looking for the saslauthd ...
0
votes
3answers
57 views

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 ...
0
votes
1answer
385 views

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 ...
25
votes
4answers
13k views

Given a PID on Windows - how do I find the command line instruction that executed it?

On a database, I can get a list of all the currently running processes, and the sql command that kicked them off. I'd like to do a similar thing on a windows box. I can get the list of processes, ...
1
vote
5answers
2k views

Get the pid if 2 tomcat(s) is running

I have 2 tomcat's running, how do I get the pid if both have similar names? ps -ef | grep java root 12952 1 0 10:01 pts/0 00:00:03 /usr/lib/jvm/jre/bin/java -Djava.util.logging.config....
3
votes
2answers
803 views

Reduce PID_MAX Safely

I have one server in a cluster that was experiencing a process table leak. Because the developer responsible for the code was unavailable for a few days I increased pid_max on the machine as follows: ...
5
votes
2answers
4k views

Is it normal for PID's to be over 65535?

I have a managed VPS running on CloudLinux 6.6 x86_64 standard. It has a few websites with MySQL, PHP and Apache running with CPanel. I am working on a PHP system that needs to manage a PID and ...
2
votes
2answers
3k views

screen command process id

First of all sorry for my bad english and i am new at linux. When i do this, it can write process id to pid file start () { echo -n "Starting someserver.jar: " java -jar /home/someserver/...
-2
votes
1answer
431 views

How to get a process ID automaticly with command prompt [closed]

I´d want to know how to get a PID of a process with a single command in command prompt. I tried it with findstr, but I´m (apparently) not so smart to figure it out. You cannot use tasklist, because ...
-2
votes
1answer
1k views

Pid and Lock files are not created in Nginx custom build Centos 7

I am trying to install nginx from source. After make install, I had a look at /var/run/ folder but I cant find the nginx.pid file and nginx.lock files there. This is my configuration: sudo ./...
0
votes
1answer
954 views

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/:/...
1
vote
1answer
2k views

Could not access pid file for elasticsearch

I am not a die-hard linux engineer, but I am having some problems with starting Elastic Search. Some stats: Server: Ubuntu Server 11.04 Elastic Search: 1.2.3 (installed with appitude) When I start ...
0
votes
1answer
932 views

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 ...
1
vote
2answers
362 views

Problems with pid files when restoring OpenVZ snapshot

I am trying different ways to take snapshots of running openvz containers. Following this guide : http://openvz.org/Checkpointing_and_live_migration, I always encounter an issue with pid files ...
2
votes
0answers
40 views

Process identifier mask in z/OS

I've noticed a curious pattern to process identifier numbers on the z/OS system I'm working on (uname reports it as OS/390), they're either 1-4 digits long or 8 digits long but never in between. The ...
1
vote
1answer
4k views

Monit is not restarting process

I have monit to monit a process but it doesn't realize it is down. My monit configuration is this: check process xxx with pidfile /var/run/xxx.pid group yyy start program = "/etc/init.d/xxx start" ...
0
votes
1answer
2k views

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 ...
2
votes
2answers
570 views

How to map an ephemeral port to a pid?

I have a RHEL server with several apps on it and I am attempting to figure out which one of them is making calls to an external web service. I have TCP dumps that show the calls being made and through ...
1
vote
0answers
196 views

Upstart shows non-existent process running

I am using upstart 1.8-0ubuntu1 on Ubuntu-1210-quantal-64-minimal. It shows me nginx to be running, when it's not. # service nginx status nginx start/running, process 2543 # ps -p 2543 PID TTY ...
4
votes
2answers
18k views

Does kill -3 actually terminate a java process? Or just generate a thread dump?

CentOS 5.9 If I run kill -3 <java process pid> what actually happens? As per this red hat article, I understand that a Java Thread Dump is generated but is the process terminated? It doesn't ...
4
votes
3answers
5k views

If I know the PID number of a process can I know its name?

If I have the PID number for a process (on a UNIX machine), how can I know the name of its associated process? What do I have to do?