Drop hurd specific dependency on libc0.3 (>= 2.3.2.ds1-12). It is
[sysvinit.git] / man / pidof.8
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 ]
25 .RB [ \-x ]
26 .RB [ \-o
27 .IR omitpid ]
28 .RB [ \-o
29 .IR omitpid.. ]
30 .B program
31 .RB [ program.. ]
32 .SH DESCRIPTION
33 .B Pidof
34 finds the process id's (pids) of the named programs. It prints those
35 id's on the standard output. This program is on some systems used in
36 run-level change scripts, especially when the system has a
37 \fISystem-V\fP like \fIrc\fP structure. In that case these scripts are
38 located in /etc/rc?.d, where ? is the runlevel. If the system has
39 a
40 .B start-stop-daemon
41 (8) program that should be used instead.
42 .SH OPTIONS
43 .IP -s
44 Single shot - this instructs the program to only return one \fIpid\fP.
45 .IP -c
46 Only return process ids that are running with the same root directory.
47 This option is ignored for non-root users, as they will be unable to check
48 the current root directory of processes they do not own.
49 .IP -x
50 Scripts too - this causes the program to also return process id's of
51 shells running the named scripts.
52 .IP "-o \fIomitpid\fP"
53 Tells \fIpidof\fP to omit processes with that process id. The special
54 pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
55 program, in other words the calling shell or shell script.
56 .SH "EXIT STATUS"
57 .TP
58 .B 0
59 At least one program was found with the requested name.
60 .TP
61 .B 1
62 No program was found with the requested name.
63 .SH NOTES
64 \fIpidof\fP is actually the same program as \fIkillall5\fP;
65 the program behaves according to the name under which it is called.
66 .PP
67 When \fIpidof\fP is invoked with a full pathname to the program it
68 should find the pid of, it is reasonably safe. Otherwise it is possible
69 that it returns pids of running programs that happen to have the same name
70 as the program you're after but are actually other programs.
71 .SH SEE ALSO
72 .BR shutdown (8),
73 .BR init (8),
74 .BR halt (8),
75 .BR reboot (8),
76 .BR killall5 (8)
77 .SH AUTHOR
78 Miquel van Smoorenburg, miquels@cistron.nl