1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
|
<!-- manual page source format generated by PolyglotMan v3.0.4, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>POSTMASTER(UNIX) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="pgsql.html">PostgreSQL Contents</A>
<H2><A NAME="sect0" HREF="#toc0">NAME </A></H2>
postmaster - run the Postgres postmaster
<H2><A NAME="sect1" HREF="#toc1">SYNOPSIS </A></H2>
<B>postmaster</B> [<B>-B</B>
n_buffers] [<B>-D</B> data_dir] [<B>-S</B>] [<B>-a</B> system] <BR>
[<B>-b</B> backend_pathname] [<B>-d</B> [debug_level]]
[<B>-i</B>] [<B>-n</B>] <BR>
[<B>-o</B> backend_options] [<B>-p</B> port] [<B>-s</B>]
<H2><A NAME="sect2" HREF="#toc2">DESCRIPTION </A></H2>
The <I>postmaster</I>
manages the communication between frontend and backend processes, as well
as allocating the shared buffer pool and semaphores (on machines without
a test-and-set instruction). The <I>postmaster</I> does not itself interact with
the user and should be started as a background process. <B>Only one postmaster
should be run on a machine.</B> <P>
The <I>postmaster</I> understands the following command-line
options:
<DL>
<DT><B>-B</B> n_buffers </DT>
<DD><I>n_buffers</I> is the number of shared-memory buffers
for the <I>postmaster</I> to allocate and manage for the backend server processes
that it starts. This value defaults to 64, and each buffer is 8k bytes.
</DD>
<DT><B>-D</B> data_dir </DT>
<DD>Specifies the directory to use as the root of the tree of
database directories. This directory uses the value of the environment
variable <FONT SIZE=-1>PGDATA.</FONT>
If <FONT SIZE=-1>PGDATA</FONT>
is not set, then the directory used is <FONT SIZE=-1>$POSTGRESHOME</FONT>
/data.
If neither environment variable is set and this command-line option is
not specified, the default directory that was set at compile-time is used.
</DD>
<DT><B>-S</B> </DT>
<DD>Specifies that the <I>postmaster</I> process should start up in silent mode.
That is, it will disassociate from the user's (controlling) tty and start
its own process group. This should not be used in combination with debugging
options because any messages printed to standard output and standard error
are discarded. </DD>
<DT><B>-a</B> system </DT>
<DD>Specifies whether or not to use the authentication
system <I>system</I> (see <I><A HREF="pgintro.1.html">pgintro</I>(1)</A>
) for frontend applications to use in connecting
to the <I>postmaster</I> process. Specify <I>system</I> to enable a system, or <B>no</B><I>system</I>
to disable a system. For example, to permit users to use <I>Kerberos</I> authentication,
use <B>-a kerberos</B>; to deny any unauthenticated connections, use <B>-a nounauth
.</B> This option no longer has any effect. </DD>
<DT><B>-b</B> backend_pathname </DT>
<DD><I>backend_pathname</I>
is the full pathname of the Postgres backend server executable file that
the <I>postmaster</I> will invoke when it receives a connection from a frontend
application. If this option is not used, then the <I>postmaster</I> tries to
find this executable file in the directory in which its own executable
is located (this is done by looking at the pathname under which the <I>postmaster</I>
was invoked. If no pathname was specified, then the <FONT SIZE=-1>PATH</FONT>
environment variable
is searched for an executable named `postgres'). </DD>
<DT><B>-d</B> [debug_level] </DT>
<DD>The optional
argument <I>debug_level</I> determines the amount of debugging output the backend
servers will produce. If <I>debug_level</I> is one, the postmaster will trace
all connection traffic, and nothing else. For levels two and higher, debugging
is turned on in the backend process and the postmaster displays more information,
including the backend environment and process traffic. Note that if no
file is specified for backend servers to send their debugging output then
this output will appear on the controlling tty of their parent <I>postmaster</I>.
</DD>
<DT><B>-i</B> </DT>
<DD>This enables TCP/IP or Internet domain socket communication. Without
this option, only local Unix domain socket communication is possible. </DD>
<DT><B>-n</B>,
<B>-s</B> </DT>
<DD>The <I>-s</I> and <I>-n</I> options control the behavior of the <I>postmaster</I> when a backend
dies abnormally. <B>Neither option is intended for use in ordinary operation
</B>. </DD>
<DT>The ordinary strategy for this situation is to notify all other </DT>
<DD>backends
that they must terminate and then reinitialize the shared memory and semaphores.
This is because an errant backend could have corrupted some shared state
before terminating. </DD>
<DT>If the </DT>
<DD><I>-s</I> option is supplied, then the <I>postmaster</I> will
stop all other backend processes by sending the signal <FONT SIZE=-1>SIGSTOP,</FONT>
but will
not cause them to terminate. This permits system programmers to collect
core dumps from all backend processes by hand. </DD>
<DT>If the </DT>
<DD><I>-n</I> option is supplied,
then the <I>postmaster</I> does not reinitialize shared data structures. A knowledgable
system programmer can then use the <I>shmemdoc</I> program to examine shared
memory and semaphore state. </DD>
<DT><B>-o</B> backend_options </DT>
<DD>The <I><A HREF="postgres.1.html">postgres</I>(1)</A>
options
specified in <I>backend_options</I> are passed to all backend server processes
started by this <I>postmaster</I>. If the option string contains any spaces, the
entire string must be quoted. </DD>
<DT><B>-p</B> port </DT>
<DD>Specifies the TCP/IP port or local
Unix domain socket file extension on which the <I>postmaster</I> is to listen
for connections from frontend applications. Defaults to 5432, or the value
of the <FONT SIZE=-1>PGPORT </FONT>
environment variable (if set). If you specify a port other
than the default port then all frontend application users must specify
the same port (using command-line options or <FONT SIZE=-1>PGPORT</FONT>
) when starting any
libpq application, including psql. </DD>
</DL>
<H2><A NAME="sect3" HREF="#toc3">WARNINGS </A></H2>
If at all possible, <B>do not</B>
use <FONT SIZE=-1>SIGKILL</FONT>
when killing the <I>postmaster</I>. <FONT SIZE=-1>SIGHUP,</FONT>
<FONT SIZE=-1>SIGINT,</FONT>
or <FONT SIZE=-1>SIGTERM</FONT>
(the
default signal for <I><A HREF="kill.1.html">kill</I>(1)</A>
) should be used instead. Hence, avoid kill
-KILL <BR>
or its alternative form kill -9 <BR>
as this will prevent the <I>postmaster</I>
from freeing the system resources (e.g., shared memory and semaphores) that
it holds before dying. This prevents you from having to deal with the
problem with <I><A HREF="shmat.2.html">shmat</I>(2)</A>
described below.
<H2><A NAME="sect4" HREF="#toc4">EXAMPLES </A></H2>
<P>
# start postmaster using
default values <BR>
nohup postmaster >logfile 2>&1 & <BR>
<P>
This command will start
up <I>postmaster</I> on the default port (5432) and will search <FONT SIZE=-1>$PATH</FONT>
to find
an executable file called `postgres'. This is the simplest and most common
way to start the <I>postmaster</I>. <P>
# start with specific port and executable
name <BR>
nohup postmaster -p -b /usr/postgres/bin/postgres & <BR>
<P>
This command
will start up a <I>postmaster</I> communicating through the port 1234, and will
attempt to use the backend located at `/usr/postgres/bin/postgres'. In order
to connect to this <I>postmaster</I> using psql, you would need to either specify
<B>-p 1234</B> on the <I>psql</I> command-line or set the environment variable <FONT SIZE=-1>PGPORT</FONT>
to 1234.
<H2><A NAME="sect5" HREF="#toc5">SEE ALSO </A></H2>
<A HREF="ipcs.1.html">ipcs(1)</A>
, <A HREF="ipcrm.1.html">ipcrm(1)</A>
, <A HREF="ipcclean.1.html">ipcclean(1)</A>
, <A HREF="psql.1.html">psql(1)</A>
, <A HREF="postgres.1.html">postgres(1)</A>
,
<H2><A NAME="sect6" HREF="#toc6">DIAGNOSTICS </A></H2>
<DL>
<DT><B>FindBackend: could not find a backend to execute...</B> </DT>
<DD>If you
see this message, you do not have the <I>postgres</I> executable in your path.
Add the directoy in which postgres resides to your path. </DD>
<DT><B>semget: No space
left on device</B> </DT>
<DD>If you see this message, you should run the <I>ipcclean</I> command.
After doing this, try starting the <I>postmaster</I> again. If this still doesn't
work, you probably need to configure your kernel for shared memory and
semaphores as described in the installation notes. If you run multiple
<I>postmaster</I>s on a single host, or have reduced the shared memory and semaphore
parameters from the defaults in the generic kernel, you may have to go
back and increase the shared memory and semaphores configured into your
kernel. </DD>
<DT><B>StreamServerPort: cannot bind to port</B> </DT>
<DD>If you see this message,
you should be certain that there is no other <I>postmaster</I> process already
running. The easiest way to determine this is by using the command ps
-ax | grep postmaster <BR>
on BSD-based systems ps -e | grep postmast <BR>
(the equivalent
syntax is on System V-like or POSIX-compliant systems such as HP-UX). If
you are sure that no other <I>postmaster</I> processes are running and you still
get this error, try specifying a different port using the <B>-p</B> option. You
may also get this error if you terminate the <I>postmaster</I> and immediately
restart it using the same port; in this case, you must simply wait a few
seconds until the operating system closes the port before trying again.
Finally, you may get this error if you specify a port number that your
operating system considers to be reserved. For example, many versions of
Unix consider port numbers under 1024 to be `trusted' and only permit the
Unix superuser to access them. </DD>
<DT><B>IpcMemoryAttach: shmat() failed: Permission
denied</B> </DT>
<DD>A likely explanation is that another user attempted to start a
<I>postmaster</I> process on the same port which acquired shared resources and
then died. Since Postgres shared memory keys are based on the port number
assigned to the <I>postmaster</I>, such conflicts are likely if there is more
than one installation on a single host. If there are no other <I>postmaster</I>
processes currently running (see above), run <I>ipcclean</I> and try again. If
other <I>postmaster</I>s are running, you will have to find the owners of those
processes to coordinate the assignment of port numbers and/or removal
of unused shared memory segments. </DD>
</DL>
<P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI>
<LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI>
<LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI>
<LI><A NAME="toc3" HREF="#sect3">WARNINGS</A></LI>
<LI><A NAME="toc4" HREF="#sect4">EXAMPLES</A></LI>
<LI><A NAME="toc5" HREF="#sect5">SEE ALSO</A></LI>
<LI><A NAME="toc6" HREF="#sect6">DIAGNOSTICS</A></LI>
</UL>
</BODY></HTML>
|