1 .\" This is -*-nroff-*-
2 .\" XXX standard disclaimer belongs here....
3 .\" $Header: /cvsroot/pgsql/src/man/Attic/postmaster.1,v 1.14 1999/02/21 03:17:31 tgl Exp $
4 .TH POSTMASTER UNIX 02/20/99 PostgreSQL PostgreSQL
6 postmaster - run the Postgres postmaster
52 manages the communication between frontend and backend processes, as
53 well as allocating the shared buffer pool and semaphores (on machines
54 without a test-and-set instruction). The
56 does not itself interact with the user and should be started as a
58 .BR "Only one postmaster should be run on a machine."
62 understands the following command-line options:
66 is the number of shared-memory buffers for the
68 to allocate and manage for the backend server processes that it
69 starts. This value defaults to 64, and each buffer is 8k bytes.
72 Specifies the directory to use as the root of the tree of database
73 directories. This directory uses the value of the environment
78 is not set, then the directory used is
80 /data. If neither environment variable is set and this command-line
81 option is not specified, the default directory that was
82 set at compile-time is used.
87 process should start up in silent mode. That is, it will disassociate
88 from the user's (controlling) tty and start its own process group.
89 This should not be used in combination with debugging options because
90 any messages printed to standard output and standard error are
94 Specifies whether or not to use the authentication system
96 for frontend applications to use in connecting to the
100 to enable a system, or
102 to disable a system. For example, to permit users to use
106 to deny any unauthenticated
109 This option no longer has any effect.
111 .BR "-N" " n_backends"
113 is the maximum number of backend server processes that this postmaster
114 is allowed to start. In the stock configuration, this value defaults
115 to 64, and can be set as high as 1024 if your system will support that
116 many processes. Both the default and upper limit values can be altered
117 when building Postgres.
119 .BR "-b" " backend_pathname"
120 .IR "backend_pathname"
121 is the full pathname of the Postgres backend server executable file that
124 will invoke when it receives a connection from a frontend application.
125 If this option is not used, then the
127 tries to find this executable file in the directory in which its own
128 executable is located (this is done by looking at the pathname under
131 was invoked. If no pathname was specified, then the
133 environment variable is searched for an executable named
136 .BR "-d" " [debug_level]"
137 The optional argument
139 determines the amount of debugging output the backend servers will
143 is one, the postmaster will trace all connection traffic,
145 For levels two and higher,
146 debugging is turned on in the backend process and the postmaster
147 displays more information,
148 including the backend environment and process traffic.
149 Note that if no file is specified for backend servers to
150 send their debugging output then this output will appear on the
151 controlling tty of their parent
155 This enables TCP/IP or Internet domain socket communication.
156 Without this option, only local Unix domain socket communication is
161 .IR "-s" " and " "-n"
162 options control the behavior of the
164 when a backend dies abnormally. \fBNeither option is intended for use in
165 ordinary operation\fP.
167 The ordinary strategy for this situation is to notify all other
168 backends that they must terminate and then reinitialize the shared
169 memory and semaphores. This is because an errant backend could have
170 corrupted some shared state before terminating.
174 option is supplied, then the
176 will stop all other backend processes by sending the signal
178 but will not cause them to terminate. This permits system programmers
179 to collect core dumps from all backend processes by hand.
183 option is supplied, then the
185 does not reinitialize shared data structures. A knowledgable system
186 programmer can then use the
188 program to examine shared memory and semaphore state.
190 .BR "-o" " backend_options"
194 .IR "backend_options"
195 are passed to all backend server processes started by this
197 If the option string contains any spaces, the entire string must be
201 Specifies the TCP/IP port or local Unix domain socket file extension
204 is to listen for connections from frontend applications. Defaults to
205 5432, or the value of the
207 environment variable (if set). If you specify a port other than the
208 default port then all frontend application users must specify the same
209 port (using command-line options or
211 ) when starting any libpq application, including psql.
223 (the default signal for
225 should be used instead. Hence, avoid
229 or its alternative form
233 as this will prevent the
235 from freeing the system resources (e.g., shared memory and semaphores)
236 that it holds before dying. This prevents you from having to deal with
243 # start postmaster using default values
244 nohup postmaster >logfile 2>&1 &
247 This command will start up
249 on the default port (5432) and will search
251 to find an executable file called \*(lqpostgres\*(rq. This is the
252 simplest and most common way to start the
256 # start with specific port and executable name
257 nohup postmaster -p -b /usr/postgres/bin/postgres &
260 This command will start up a
262 communicating through the port 1234, and will attempt to use the
263 backend located at \*(lq/usr/postgres/bin/postgres\*(rq. In order to
266 using psql, you would need to either
271 command-line or set the environment variable
282 .BR "FindBackend: could not find a backend to execute..."
283 If you see this message, you do not have the
285 executable in your path. Add the directoy in which postgres resides to
288 .BR "semget: No space left on device"
289 If you see this message, you should run the
291 command. After doing this, try starting the
293 again. If this still doesn't work, you probably need to configure
294 your kernel for shared memory and semaphores as described in the
295 installation notes. If you run multiple
297 on a single host, or have reduced the shared memory and semaphore
298 parameters from the defaults in the generic kernel, you may have to
299 go back and increase the shared memory and semaphores configured
302 .BR "StreamServerPort: cannot bind to port"
303 If you see this message, you should be certain that there is no other
305 process already running. The easiest way to determine this is by
308 ps -ax | grep postmaster
312 ps -e | grep postmast
314 (the equivalent syntax is on System V-like or POSIX-compliant systems such as HP-UX). If you
315 are sure that no other
317 processes are running and you still get this error, try specifying a
318 different port using the
320 option. You may also get this error if you terminate the
322 and immediately restart it using the same port; in this case, you must
323 simply wait a few seconds until the operating system closes the port
324 before trying again. Finally, you may get this error if you specify
325 a port number that your operating system considers to be reserved.
326 For example, many versions of Unix consider port numbers under 1024 to
327 be \*(lqtrusted\*(rq and only permit the Unix superuser to access them.
329 .BR "IpcMemoryAttach: shmat() failed: Permission denied"
330 A likely explanation is that another user attempted to start a
332 process on the same port which acquired shared resources and then
333 died. Since Postgres shared memory keys are based on the port number
336 such conflicts are likely if there is more than one installation on
337 a single host. If there are no other
339 processes currently running (see above), run
341 and try again. If other
343 are running, you will have to find the owners of those processes to
344 coordinate the assignment of port numbers and/or removal of unused
345 shared memory segments.