Sponsored Content
Top Forums UNIX for Dummies Questions & Answers what is the meaning of ppid 1? Post 302129918 by benefactr on Thursday 2nd of August 2007 09:06:42 AM
Old 08-02-2007
This may not be 100% correct, but most processes that have a ppid of 1 are the system processes that are started up, tty's and other things. You can also have this when you kill the parent and it still had some child process out there running. Like if you killed cron and it had jobs running, those running processes would have a 1 on them.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

strange pid and ppid problem

Hi all, Please look into the following code : int main() { char command; int pid, ppid; ppid = getpid(); /* Get the parent pid */ pid = fork(); /* Fork */ if ( pid ==0 ) { sprintf( command, " gdb a.out %d ", ppid ); printf( "Command line is %s\n", command ); system( command... (3 Replies)
Discussion started by: asvija
3 Replies

2. Shell Programming and Scripting

Need a script to kill processes with PPID of 1

Hi, I have been trying to come up with a script to run as a cron job to kill any processes that have PPID of 1. I have created a file that contains the PID and the PPID. How can I read this file and then execute a kill on any PID where PPID is 1. The file looks like this: 4904 1 4455 1... (5 Replies)
Discussion started by: lbaysdon
5 Replies

3. UNIX for Advanced & Expert Users

' ps v PPID' command and real memory

hi Guys, Just wondering whether if I execute the ps v 1818740 and I get the below ouput what column should I use If I need to calculate how much real memory (private) is use by those process. Thanks. PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND ... (1 Reply)
Discussion started by: hariza
1 Replies

4. Solaris

why process PPID changes to 1

Hi All, I have just started using SUN Solaris o.s version is :SunOS spdwa013(my server name) 5.8 Generic_117350-61 sun4u sparc SUNW,Sun-Fire-480R My problem is that i have some processes running on that server they have a PID and a PPID. But sometimes the PPID for a particular process... (2 Replies)
Discussion started by: usha rao
2 Replies

5. UNIX for Dummies Questions & Answers

Starting a process whose ppid should be 1

How can I start a process with ppid as 1 instead of my current shell pid? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

6. Shell Programming and Scripting

Shall I go for uid or ppid?

Hi Guys, I'd like to ask your advice on the following, I've written this script to terminate a given process by name: #!/bin/bash echo 'Please enter the process you wish to terminate' read process pid=$(pidof $process) kill -9 $pid echo $2 to make it safer I want it to reject the... (4 Replies)
Discussion started by: Lora Graham
4 Replies

7. Solaris

Start process independent from TERMINAL (or also with PPID 1)

Hi *, please, I need fast tip (help). I have a process starting through /etc/rc3.d/xxxx script. However, sometimes (mostly because of testing reasons) I need to stop the process, change something and then start it again. But: 1) when I start it in terminal, the process dies when I leave the... (2 Replies)
Discussion started by: freeangel
2 Replies

8. UNIX for Advanced & Expert Users

PPID differs in script and prompt

I tried several times to get answer to the below problem. Someone can please help me? $ cat p1.sh #!/bin/sh `./c1.sh &` while # indefinite loop do x=5; done $ cat c1.sh # sleep for 10 sec and exit #!/bin/sh sleep 10; Execute P1 as ./p1 & $ ps -eaf | grep c1... (1 Reply)
Discussion started by: alexalex1
1 Replies

9. UNIX for Dummies Questions & Answers

Process Name from PPID

Hi, I am currently trying to pin down a process NAME (could be a cron job or a tty) in Solaris. First I obtained a pid and then a ppid. I want to take the PPID and from there find the program/process that is making the VSH go high (cpu usage). I am currently trying to go up the chain using PS... (2 Replies)
Discussion started by: troystevens
2 Replies

10. UNIX for Dummies Questions & Answers

PID and PPID - please explain :(-

Hi, I need some help understanding PID and PPID that is shown by the ps -ef output. OS is Solaris 5.8. :wall: There are several Oracle databases and processes running on this server and they all have the same PPID. Does that mean they are all spawned off the same startup script? I then... (1 Reply)
Discussion started by: newbie_01
1 Replies
PGREP(1)							Linux User's Manual							  PGREP(1)

NAME
pgrep, pkill - look up or signal processes based on name and other attributes SYNOPSIS
pgrep [-cflvx] [-d delimiter] [-n|-o] [-P ppid,...] [-g pgrp,...] [-s sid,...] [-u euid,...] [-U uid,...] [-G gid,...] [-t term,...] [pat- tern] pkill [-signal] [-fvx] [-n|-o] [-P ppid,...] [-g pgrp,...] [-s sid,...] [-u euid,...] [-U uid,...] [-G gid,...] [-t term,...] [pattern] DESCRIPTION
pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout. All the cri- teria have to match. For example, $ pgrep -u root sshd will only list the processes called sshd AND owned by root. On the other hand, $ pgrep -u root,daemon will list the processes owned by root OR daemon. pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. OPTIONS
-c Suppress normal output; instead print a count of matching processes. -d delimiter Sets the string used to delimit each process ID in the output (by default a newline). (pgrep only.) -f The pattern is normally only matched against the process name. When -f is set, the full command line is used. -g pgrp,... Only match processes in the process group IDs listed. Process group 0 is translated into pgrep's or pkill's own process group. -G gid,... Only match processes whose real group ID is listed. Either the numerical or symbolical value may be used. -l List the process name as well as the process ID. (pgrep only.) -n Select only the newest (most recently started) of the matching processes. -o Select only the oldest (least recently started) of the matching processes. -P ppid,... Only match processes whose parent process ID is listed. -s sid,... Only match processes whose process session ID is listed. Session ID 0 is translated into pgrep's or pkill's own session ID. -t term,... Only match processes whose controlling terminal is listed. The terminal name should be specified without the "/dev/" prefix. -u euid,... Only match processes whose effective user ID is listed. Either the numerical or symbolical value may be used. -U uid,... Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used. -v Negates the matching. -x Only match processes whose name (or command line if -f is specified) exactly match the pattern. -signal Defines the signal to send to each matched process. Either the numeric or the symbolic signal name can be used. (pkill only.) OPERANDS
pattern Specifies an Extended Regular Expression for matching against the process names or command lines. EXAMPLES
Example 1: Find the process ID of the named daemon: $ pgrep -u root named Example 2: Make syslog reread its configuration file: $ pkill -HUP syslogd Example 3: Give detailed information on all xterm processes: $ ps -fp $(pgrep -d, -x xterm) Example 4: Make all netscape processes run nicer: $ renice +4 `pgrep netscape` EXIT STATUS
0 One or more processes matched the criteria. 1 No processes matched. 2 Syntax error in the command line. 3 Fatal error: out of memory etc. NOTES
The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline. The running pgrep or pkill process will never report itself as a match. BUGS
The options -n and -o and -v can not be combined. Let me know if you need to do this. Defunct processes are reported. SEE ALSO
ps(1), regex(7), signal(7), killall(1), skill(1), kill(1), kill(2) STANDARDS
pkill and pgrep were introduced in Sun's Solaris 7. This implementation is fully compatible. AUTHOR
Kjetil Torgrim Homme <kjetilho@ifi.uio.no> Albert Cahalan <albert@users.sf.net> is the current maintainer of the procps package. Please send bug reports to <procps-feedback@lists.sf.net> Linux October 5, 2007 PGREP(1)
All times are GMT -4. The time now is 11:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy