]>
Commit | Line | Data |
---|---|---|
a74aeac6 PR |
1 | '\" -*- coding: UTF-8 -*- |
2 | .\" Copyright (C) 1998 Miquel van Smoorenburg. | |
3 | .\" | |
4 | .\" This program is free software; you can redistribute it and/or modify | |
5 | .\" it under the terms of the GNU General Public License as published by | |
6 | .\" the Free Software Foundation; either version 2 of the License, or | |
7 | .\" (at your option) any later version. | |
8 | .\" | |
9 | .\" This program is distributed in the hope that it will be useful, | |
10 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | .\" GNU General Public License for more details. | |
13 | .\" | |
14 | .\" You should have received a copy of the GNU General Public License | |
15 | .\" along with this program; if not, write to the Free Software | |
16 | .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | .\" | |
18 | .TH PIDOF 8 "01 Sep 1998" "" "Linux System Administrator's Manual" | |
19 | .SH NAME | |
20 | pidof -- find the process ID of a running program. | |
21 | .SH SYNOPSIS | |
22 | .B pidof | |
23 | .RB [ \-s ] | |
24 | .RB [ \-c ] | |
40fc1ac0 | 25 | .RB [ \-n ] |
a74aeac6 PR |
26 | .RB [ \-x ] |
27 | .RB [ \-o | |
40fc1ac0 | 28 | .IR omitpid[,omitpid..] ] |
a74aeac6 | 29 | .RB [ \-o |
40fc1ac0 | 30 | .IR omitpid[,omitpid..].. ] |
a74aeac6 PR |
31 | .B program |
32 | .RB [ program.. ] | |
33 | .SH DESCRIPTION | |
34 | .B Pidof | |
35 | finds the process id's (pids) of the named programs. It prints those | |
36 | id's on the standard output. This program is on some systems used in | |
37 | run-level change scripts, especially when the system has a | |
38 | \fISystem-V\fP like \fIrc\fP structure. In that case these scripts are | |
39 | located in /etc/rc?.d, where ? is the runlevel. If the system has | |
40 | a | |
41 | .B start-stop-daemon | |
42 | (8) program that should be used instead. | |
43 | .SH OPTIONS | |
40fc1ac0 | 44 | .IP \-s |
a74aeac6 | 45 | Single shot - this instructs the program to only return one \fIpid\fP. |
40fc1ac0 | 46 | .IP \-c |
a74aeac6 PR |
47 | Only return process ids that are running with the same root directory. |
48 | This option is ignored for non-root users, as they will be unable to check | |
49 | the current root directory of processes they do not own. | |
40fc1ac0 DWF |
50 | .IP \-n |
51 | Avoid | |
52 | .BR stat (2) | |
53 | system function call on all binaries which are located on network | |
54 | based file systems like | |
55 | .BR NFS . | |
56 | Instead of using this option the the variable | |
57 | .B PIDOF_NETFS | |
58 | may be set and exported. | |
59 | .IP \-x | |
a74aeac6 PR |
60 | Scripts too - this causes the program to also return process id's of |
61 | shells running the named scripts. | |
62 | .IP "-o \fIomitpid\fP" | |
63 | Tells \fIpidof\fP to omit processes with that process id. The special | |
64 | pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP | |
65 | program, in other words the calling shell or shell script. | |
66 | .SH "EXIT STATUS" | |
67 | .TP | |
68 | .B 0 | |
69 | At least one program was found with the requested name. | |
70 | .TP | |
71 | .B 1 | |
72 | No program was found with the requested name. | |
73 | .SH NOTES | |
74 | \fIpidof\fP is actually the same program as \fIkillall5\fP; | |
75 | the program behaves according to the name under which it is called. | |
76 | .PP | |
77 | When \fIpidof\fP is invoked with a full pathname to the program it | |
78 | should find the pid of, it is reasonably safe. Otherwise it is possible | |
79 | that it returns pids of running programs that happen to have the same name | |
80 | as the program you're after but are actually other programs. | |
81 | .SH SEE ALSO | |
82 | .BR shutdown (8), | |
83 | .BR init (8), | |
84 | .BR halt (8), | |
85 | .BR reboot (8), | |
86 | .BR killall5 (8) | |
87 | .SH AUTHOR | |
88 | Miquel van Smoorenburg, miquels@cistron.nl |