head 1.20; access; symbols; locks; strict; comment @# @; 1.20 date 94.03.28.21.57.21; author aoki; state Exp; branches; next 1.19; 1.19 date 94.02.12.09.59.58; author aoki; state Exp; branches; next 1.18; 1.18 date 94.02.07.10.48.19; author aoki; state Exp; branches; next 1.17; 1.17 date 93.04.07.18.38.42; author mao; state Exp; branches; next 1.16; 1.16 date 93.03.23.00.53.44; author aoki; state Exp; branches; next 1.15; 1.15 date 93.02.06.01.07.02; author devine; state Exp; branches; next 1.14; 1.14 date 93.01.26.02.43.13; author aoki; state Exp; branches; next 1.13; 1.13 date 92.09.05.23.14.09; author mao; state Exp; branches; next 1.12; 1.12 date 92.08.18.18.14.12; author mao; state Exp; branches; next 1.11; 1.11 date 92.07.14.05.54.17; author ptong; state Exp; branches; next 1.10; 1.10 date 92.07.13.03.45.59; author ptong; state Exp; branches; next 1.9; 1.9 date 92.07.12.21.10.19; author ptong; state Exp; branches; next 1.8; 1.8 date 92.06.17.22.07.21; author mer; state Exp; branches; next 1.7; 1.7 date 91.08.17.02.05.34; author kemnitz; state Exp; branches; next 1.6; 1.6 date 91.08.16.01.03.45; author mer; state Exp; branches; next 1.5; 1.5 date 91.08.16.00.42.51; author kemnitz; state Exp; branches; next 1.4; 1.4 date 91.03.09.05.04.51; author kemnitz; state Exp; branches; next 1.3; 1.3 date 90.08.01.10.52.38; author cimarron; state Exp; branches; next 1.2; 1.2 date 90.07.29.04.15.45; author kemnitz; state Exp; branches; next 1.1; 1.1 date 90.07.29.03.47.22; author kemnitz; state Exp; branches; next ; desc @Description of the Postmaster command. @ 1.20 log @beef up errormessage section @ text @.\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... .\" $Header: /usr/local/devel/postgres/src/ref/unix/RCS/postmaster.1src,v 1.19 1994/02/12 09:59:58 aoki Exp aoki $ .TH POSTMASTER UNIX 02/12/94 .XA 1 "The \*(PG Postmaster" .SH "NAME" postmaster \(em run the \*(PG postmaster .SH "SYNOPSIS" .BR "postmaster" [\c .BR "-B" n_buffers] [\c .BR "-D" data_dir] [\c .BR "-S" \c ] [\c .BR "-a" system] .br .in +5n [\c .BR "-b" backend_pathname] [\c .BR "-d" [debug_level]] [\c .BR "-n" \c ] .br [\c .BR "-o" backend_options] [\c .BR "-p" port] [\c .BR "-s" \c ] .in -5n .SH "DESCRIPTION" The .IR "postmaster" 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 .IR postmaster does not itself interact with the user and should be started as a background process. .BR "Only one postmaster should be run on a machine." .PP The .IR "postmaster" understands the following command-line options: .TP 5n .BR "-B" " n_buffers" .IR "n_buffers" is the number of shared-memory buffers for the .IR "postmaster" to allocate and manage for the backend server processes that it starts. This value defaults to 64. .TP .BR "-D" " data_dir" Specifies the directory to use as the root of the tree of database directories. This directory uses the value of the environment variable .SM PGDATA. If .SM PGDATA is not set, then the directory used is .SM $POSTGRESHOME\c /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. .TP .BR "-S" Specifies that the .IR "postmaster" 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. .TP .BR "-a" " system" Specifies whether or not to use the authentication system .IR "system" (see .IR introduction (unix)) for frontend applications to use in connecting to the .IR postmaster process. Specify .IR "system" to enable a system, or .BI "no" "system" to disable a system. For example, to permit users to use .IR Kerberos authentication, use .BR "-a kerberos" ; to deny any unauthenticated connections, use .BR "-a nounauth . The default is site-specific. .TP .BR "-b" " backend_pathname" .IR "backend_pathname" is the full pathname of the \*(PG backend server executable file that the .IR "postmaster" will invoke when it receives a connection from a frontend application. If this option is not used, then the .IR postmaster 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 .IR "postmaster" was invoked. If no pathname was specified, then the .SM PATH environment variable is searched for an executable named \*(lqpostgres\*(rq). .TP .BR "-d" " [debug_level]" The optional argument .IR debug_level determines the amount of debugging output the backend servers will produce. If .I debug_level 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 (e.g., using the .BR "-t" option of .IR monitor or the .BR "-o" option of .IR postgres ) then this output will appear on the controlling tty of their parent .IR postmaster . .TP .BR "-n" ", " "-s" The .IR "-s" " and " "-n" options control the behavior of the .IR "postmaster" when a backend dies abnormally. \fBNeither option is intended for use in ordinary operation\fP. .IP The ordinary strategy for this situation is to notify all other 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. .IP If the .IR "-s" option is supplied, then the .IR "postmaster" will stop all other backend processes by sending the signal .SM SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all backend processes by hand. .IP If the .IR "-n" option is supplied, then the .IR "postmaster" does not reinitialize shared data structures. A knowledgable system programmer can then use the .IR shmemdoc program to examine shared memory and semaphore state. .TP .BR "-o" " backend_options" The .IR postgres (unix) options specified in .IR "backend_options" are passed to all backend server processes started by this .IR postmaster . If the option string contains any spaces, the entire string must be quoted. .TP .BR "-p" " port" Specifies the Internet TCP port on which the .IR postmaster is to listen for connections from frontend applications. Defaults to 4321, or the value of the .SM PGPORT 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 .SM PGPORT\c ) when starting any libpq application, including the terminal monitor. .SH "WARNINGS" If at all possible, .BR "do not" use .SM SIGKILL when killing the .IR "postmaster" "." .SM SIGHUP, .SM SIGINT, or .SM SIGTERM (the default signal for .IR "kill" "(1))" should be used instead. Hence, avoid .(C kill -KILL .)C or its alternative form .(C kill -9 .)C as this will prevent the .IR postmaster 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 .IR shmat (2) described below. .SH "EXAMPLES" .(C # start postmaster using default values postmaster & .)C This command will start up .IR "postmaster" on the default port (4321) and will search .SM $PATH to find an executable file called \*(lqpostgres\*rq. This is the simplest and most common way to start the .IR "postmaster" . .(C # start with specific port and executable name postmaster -p 1234 -b /usr/postgres/bin/postgres & .)C This command will start up a .IR "postmaster" communicating through the port 1234, and will attempt to use the backend located at \*(lq/usr/postgres/bin/postgres\*(rq. In order to connect to this .IR "postmaster" using the terminal monitor, you would need to either specify .BR "-p 1234" on the .IR "monitor" command-line or set the environment variable .SM PGPORT to 1234. .SH "SEE ALSO" ipcs(1), ipcrm(1), ipcclean(unix), monitor(unix), postgres(unix), shmemdoc(unix). .SH "DIAGNOSTICS" .TP .BR "semget: No space left on device" If you see this message, you should run the .IR "ipcclean" command. After doing this, try starting the .IR "postmaster" 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 .IR postmaster 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. .TP .BR "StreamServerPort: cannot bind to port" If you see this message, you should be certain that there is no other .IR "postmaster" process already running. The easiest way to determine this is by using the command .(C ps -ax | grep postmaster .)C on BSD-based systems (the equivalent syntax is .(C ps -e | grep postmast .)C on System V-like or POSIX-compliant systems such as HP-UX). If you are sure that no other .IR "postmaster" processes are running and you still get this error, try specifying a different port using the .BR "-p" option. You may also get this error if you terminate the .IR "postmaster" 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 \*(UU consider port numbers under 1024 to be \*(lqtrusted\*(rq and only permit the \*(UU superuser to access them. .TP .BR "IpcMemoryAttach: shmat() failed: Permission denied" A likely explanation is that another user attempted to start a .IR "postmaster" process on the same port which acquired shared resources and then died. Since \*(PG shared memory keys are based on the port number assigned to the .IR "postmaster" , such conflicts are likely if there is more than one installation on a single host. If there are no other .IR "postmaster" processes currently running (see above), run .IR "ipcclean" and try again. If other .IR "postmaster" 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. @ 1.19 log @another note about hpux @ text @d3 1 a3 1 .\" $Header: /usr/local/devel/postgres/src/ref/unix/RCS/postmaster.1src,v 1.18 1994/02/07 10:48:19 aoki Exp aoki $ d226 4 a229 1 that it holds before dying. d276 6 a281 1 installation notes. d305 4 a308 1 before trying again. d311 1 a311 1 A likely explanation is that a d313 6 a318 2 process owned by another user has acquired all of the shared resources on the machine. If there are no other d320 1 a320 1 processes running (see above), run d322 5 a326 1 and try again. @ 1.18 log @added -S (silent) option @ text @d3 2 a4 2 .\" $Header: /usr/local/devel/postgres/src/ref/unix/RCS/postmaster.1src,v 1.17 1993/04/07 18:38:42 mao Exp aoki $ .TH POSTMASTER UNIX 01/23/93 d285 1 a285 1 ps -e | grep postmaster @ 1.17 log @describe new behavior of -d. @ text @d3 1 a3 1 .\" $Header: /private/src/postgres/src/ref/unix/RCS/postmaster.1src,v 1.16 1993/03/23 00:53:44 aoki Exp mao $ d17 3 d31 1 a31 1 .BR "-n" d41 1 a41 1 .BR "-s" d79 9 d155 2 a156 2 when a backend dies abnormally. Neither option is intended for use in ordinary operation. d200 2 a201 2 .SM PGPORT ) when starting any libpq application, including the terminal monitor. d283 6 a288 1 If you are sure that no other @ 1.16 log @added a note not to kill -9 the postmaster @ text @d3 1 a3 1 .\" $Header: /home2/aoki/master/src/ref/unix/RCS/postmaster.1src,v 1.15 1993/02/06 01:07:02 devine Exp aoki $ d117 10 a126 1 produce. Note that if no file is specified for backend servers to @ 1.15 log @added comments to the examples; some rewording @ text @d3 1 a3 1 .\" $Header: /usr/local/devel/postgres/ref/unix/RCS/postmaster.1src,v 1.14 1993/01/26 02:43:13 aoki Exp devine $ d181 25 d222 1 a222 3 This command will start up a postmaster communicating through the port 1234, and will attempt to use the backend located at \*(lq/usr/postgres/bin/postgres\*(rq. In order to connect to this d224 4 d237 2 d272 10 @ 1.14 log @-man version @ text @d3 1 a3 1 .\" $Header: /home2/aoki/ref/unix/RCS/postmaster,v 1.13 1992/09/05 23:14:09 mao Exp aoki $ d65 1 a65 1 directories. This directory defaults to the value of the environment d67 2 a68 2 .SM PGDATA ; if d70 1 a70 1 is not set, then the default is d73 2 a74 1 option is not specified, a default set at compile-time is used. d108 1 a108 1 was invoked; if no pathname was specified, then the d183 1 d194 1 @ 1.13 log @new flag '-D' to use directories other that POSTGRESHOME/data as the data directory. also, PGDATA overrides the default (but -D overrides PGDATA). @ text @d1 1 d3 39 a41 42 .\" $Header: /private/mao/postgres/ref/unix/RCS/postmaster,v 1.12 1992/08/18 18:14:12 mao Exp mao $ .SP POSTMASTER UNIX 6/14/90 .XA 1 "The \*(PP Postmaster" .uh "NAME" .lp postmaster \*- run the \*(PP postmaster .uh "SYNOPSIS" .lp .(l \fBpostmaster\fR [ -p port ] [ -b backend_pathname ] [ -d debug_level ] [ -D data_dir] [ -s ] [ -n ] & .)l .uh "DESCRIPTION" .lp The postmaster manages the communication between frontends and backends, as well as allocating the shared buffer pool and semaphores (on machines without TAS). The postmaster does not itself interact with the user so it should be started as a background process. \fBOnly one postmaster should be run on a machine!\fR .sp .uh "COMMAND OPTIONS" .lp \fIport\fR is the well known TCP/IP port used for network communication between a libpq application and the backend. If you specify a port other than the default port then you must specify the same port when starting any libpq application including the terminal monitor. Alternatively you may set the environment variable PGPORT to the specified port and all libpq applications will use it instead of the default. .lp \fIbackend_pathname\fR is the full pathname of the \*(PP backend you wish to use. .lp \fIdeug_level\fR determines the amount of debugging output the backend will produce. Specifying any level will cause the postmaster to print out a few terse debugging output messages to the tty on which it was started. .lp The \fI\-D\fP option specifies the directory to use as the root of the tree of database directories. By default, this is $PGDATA; if PGDATA is not defined in the environment, then the default is $POSTGRESHOME/data. .lp d43 139 a181 27 \fI\-s\fP and \fI\-n\fP options control the behavior of the postmaster when a backend dies abnormally. The ordinary strategy for this situation is to notify all other backends that they must terminate, and to reinitialize shared memory and semaphores. This is because an errant backend, before dumping core, could have contaminated some shared state. .lp If the \fI\-s\fP option is supplied, then the postmaster will stop all other backends, but will not cause them to terminate. This permits system programmers to collect core dumps from all concurrent backends by hand. .lp If the \fI\-n\fP command-line option is supplied, then the postmaster does not reinitialize shared data structures. A knowledgable system programmer can use the .i shmemdoc program to examine shared memory and semaphore state, in order to debug the problem. .lp Neither \fI\-s\fP nor \fI\-n\fP is intended for use in ordinary operation. .sp .uh "EXAMPLES" .lp .ft C d183 11 a193 12 .ft .lp This command will start up a postmaster on the default port (4321) and will expect to use the default path to the \*(PP backend ($POSTGRESHOME/bin/postgres) or /usr/postgres/bin/postgres. This is the simplest and most common way to start the postmaster. .sp .lp .ft C postmaster -p 1234 -b /a/postgres/bin/postgres & .ft .lp d195 28 a222 16 1234, and will expect to use the backend located at /a/postgres/bin/postgres. Note: to connect to this postmaster using the terminal monitor, you would need to specify \fB-p 1234\fR on the command line invoking the terminal monitor. .sp .uh "DIAGNOSTICS" .lp \fBsemget: No space left on device\fR .lp If you see this message, you should run the \fIipcclean\fR command. After doing this, try starting the postmaster again. If this still doesn't work, you will need to configure your kernel for shared memory and semaphores as described in the installation notes. .lp \fBStreamServerPort: cannot bind to port\fR .lp d224 16 a239 11 postmaster program already running. The easiest way to determine this is by the command "ps -ax | grep postmaster". If you are sure there is no other postmaster running and you still get this error try specifying a different port using the -p option. You may also get this error if you terminate the postmaster and immediately restart it using the same port; in this case, you should simply wait until the operating system closes the port. .lp .uh "SEE ALSO" .lp postgres(unix), monitor(unix), ipcclean(unix), shmemdoc(unix). @ 1.12 log @add text about new cmd-line options -n, -s for use in debugging shared execution problems. @ text @d2 1 a2 1 .\" $Header: /private/mao/postgres/ref/unix/RCS/postmaster,v 1.11 1992/07/14 05:54:17 ptong Exp $ d11 1 a11 1 \fBpostmaster\fR [ -p port ] [ -b backend_pathname ] [ -d debug_level ] [ -s ] [ -n ] & d36 7 @ 1.11 log @reformated @ text @d2 1 a2 1 .\" $Header: /home/postgres/mer/refs/unix/RCS/postmaster,v 1.10 1992/07/13 03:45:59 ptong Exp ptong $ d11 1 a11 1 \fBpostmaster\fR [ -p port ] [ -b backend_pathname ] [ -d debug_level ] & d36 25 d106 1 a106 1 postgres(unix), monitor(unix), ipcclean(unix). @ 1.10 log @Fixed up formating @ text @d2 1 a2 1 .\" $Header: /home/postgres/mer/refs/unix/RCS/postmaster,v 1.9 1992/07/12 21:10:19 ptong Exp ptong $ d81 1 a81 3 postgres (unix), monitor (unix), ipcclean (unix) @ 1.9 log @Changed references to POSTGRES to the macro \*(PP. @ text @d2 1 a2 1 .\" $Header: /home/postgres/mer/refs/unix/RCS/postmaster,v 1.8 1992/06/17 22:07:21 mer Exp ptong $ d10 3 a12 1 postmaster [ -p port ] [ -b backend_pathname ] [ -d debug_level ] & d39 3 a41 1 \fBpostmaster &\fR d49 3 a51 1 \fBpostmaster -p 1234 -b /a/postgres/bin/postgres &\fR @ 1.8 log @added a parenthetical comment @ text @d2 1 a2 1 .\" $Header: /home/postgres/mer/refs/unix/RCS/postmaster,v 1.7 1991/08/17 02:05:34 kemnitz Exp mer $ d4 1 a4 1 .XA 1 "The Postgres Postmaster" d7 1 a7 1 postmaster \*- run the Postgres postmaster d28 1 a28 1 \fIbackend_pathname\fR is the full pathname of the Postgres backend you d41 1 a41 1 postgres backend ($POSTGRESHOME/bin/postgres) or /usr/postgres/bin/postgres. @ 1.7 log @added another blurb on "cannot bind to port" @ text @d2 1 a2 1 .\" $Header: RCS/postmaster,v 1.6 91/08/16 01:03:45 mer Exp Locker: kemnitz $ d14 2 a15 1 as well as allocating the shared buffer pool and semaphores. The postmaster @ 1.6 log @updated postmaster for version 3.0 its now a work of art @ text @d2 1 a2 1 .\" $Header: RCS/postmaster,v 1.4 91/03/09 05:04:51 kemnitz Exp $ d67 4 a70 1 different port using the -p option. @ 1.5 log @replaced paragraphs with linefeeds - looks better. @ text @d2 1 a2 1 .\" $Header: RCS/postmaster,v 1.4 91/03/09 05:04:51 kemnitz Exp Locker: kemnitz $ d10 1 a10 1 postmaster [ -p port ] [ -b backend_pathname ] & d16 1 a16 1 process. Only one postmaster should be run on a machine. d21 5 a25 2 communication between the terminal monitor and the backend. If you specify this then you must also specify them when starting the terminal monitor. d29 4 d38 2 a39 2 This command will start up a postmaster on the default ports (4321 and 4322) which will expect to use the default path to the d41 1 a41 1 This is the simplest way to start the postmaster. d46 2 a47 2 This command will start up a postmaster communicating through ports 1234 and 1235, which will expect to use the backend located at d60 8 @ 1.4 log @Changed command line syntax. @ text @d2 1 a2 1 .\" $Header: RCS/postmaster,v 1.3 90/08/01 10:52:38 cimarron Exp $ d30 1 a30 1 .pp d38 1 a38 1 .pp d48 1 a48 1 .pp d53 1 a53 1 .pp @ 1.3 log @corrected the command line options stuff. @ text @d2 1 a2 1 .\" $Header: RCS/postmaster,v 1.2 90/07/29 04:15:45 kemnitz Exp Locker: cimarron $ d10 1 a10 2 .b postmaster [port port+1 0 backendpath] & d16 1 a16 1 process. d20 1 a20 1 \fIport\fR and \fIport+1\fR are the well known TCP/IP ports used for network d22 1 a22 1 these then you must also specify them when starting the terminal monitor. d24 2 a25 3 The third argument should always be \fI0\fR. .lp \fIbackendname\fR is the full pathname of the Postgres backend you wish to use. d33 2 a34 2 postgres backend (~/bin/postgres). This is the simplest way to start the postmaster. d37 1 a37 1 \fBpostmaster 1234 1235 0 /usr/postgres/bin/postgres &\fR d41 1 a41 1 /usr/postgres/bin/postgres. Note: to connect to this postmaster using @ 1.2 log @Added some stuff. @ text @d2 1 a2 1 .\" $Header: RCS/postmaster,v 1.1 90/07/29 03:47:22 kemnitz Exp Locker: kemnitz $ d5 1 a5 1 .uh NAME d8 1 a8 1 .uh SYNOPSIS d11 2 a12 2 [-h hostname] [-p port -p port+1] [backendname] .uh DESCRIPTION d15 17 a31 7 as well as allocating the shared buffer pool and semaphores. \fBCommand options:\fR .uh "-h" The host on which the POSTGRES backend is running; default is your local machine (localhost). d33 7 a39 3 .uh "-p" The port used for network communication between the terminal monitor and the backend. You must also use "port + 1" if you use this option. d41 6 a46 17 .uh "backendname" the pathname of the Postgres backend you wish to use. .pp You may set environment variables to avoid typing the above options. The corresponding environment variables are: .(l hostname: PGHOST port: PGPORT options: PGOPTION .)l The postmaster requires that the environment variable .uh "POSTGRESHOME" be set. d49 5 a53 2 "semget: No space left on device". Run the ipcclean command. If this still doesn't work, you will need to configure your kernel for shared memory and d58 1 @ 1.1 log @Initial revision @ text @d2 1 a2 1 .\" $Header: RCS/monitor,v 1.2 90/07/19 15:49:24 claire Exp $ d28 1 a28 1 the name of the \*PP backend you wish to use. d37 1 a37 1 options: PGOPTION d43 11 @