<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.43 2007/11/10 14:07:18 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.44 2007/11/10 21:48:51 momjian Exp $
PostgreSQL documentation
-->
<refsynopsisdiv>
<cmdsynopsis>
+
<command>pg_ctl</command>
<arg choice="plain">start</arg>
<arg>-w</arg>
+ <arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-l <replaceable>filename</replaceable></arg>
<arg>-p <replaceable>path</replaceable></arg>
<arg>-c</arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">stop</arg>
<arg>-W</arg>
+ <arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-m
</group>
</arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">restart</arg>
<arg>-w</arg>
+ <arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-c</arg>
</arg>
<arg>-o <replaceable>options</replaceable></arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">reload</arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">status</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">kill</arg>
<arg><replaceable>signal_name</replaceable></arg>
<arg><replaceable>process_id</replaceable></arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">register</arg>
<arg>-N <replaceable>servicename</replaceable></arg>
<arg>-P <replaceable>password</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-w</arg>
+ <arg>-t <replaceable>seconds</replaceable></arg>
<arg>-o <replaceable>options</replaceable></arg>
<sbr>
+
<command>pg_ctl</command>
<arg choice="plain">unregister</arg>
<arg>-N <replaceable>servicename</replaceable></arg>
+
</cmdsynopsis>
</refsynopsisdiv>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>-t</option></term>
+ <listitem>
+ <para>
+ The number of seconds to wait when waiting for start or shutdown
+ to complete.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>-w</option></term>
<listitem>
<para>
- Wait for the start or shutdown to complete. Times out after
- 60 seconds. This is the default for shutdowns. A successful
+ Wait for the start or shutdown to complete. The default wait time
+ is 60 seconds. This is the default option for shutdowns. A successful
shutdown is indicated by removal of the <acronym>PID</acronym>
file. For starting up, a successful <command>psql -l</command>
indicates success. <command>pg_ctl</command> will attempt to
*
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.85 2007/10/31 10:55:25 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.86 2007/11/10 21:48:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
printf(_("%s is a utility to start, stop, restart, reload configuration files,\n"
"report the status of a PostgreSQL server, or signal a PostgreSQL process.\n\n"), progname);
printf(_("Usage:\n"));
- printf(_(" %s start [-w] [-D DATADIR] [-s] [-l FILENAME] [-o \"OPTIONS\"]\n"), progname);
+ printf(_(" %s start [-w] [-t secs] [-D DATADIR] [-s] [-l FILENAME] [-o \"OPTIONS\"]\n"), progname);
printf(_(" %s stop [-W] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n"), progname);
- printf(_(" %s restart [-w] [-D DATADIR] [-s] [-m SHUTDOWN-MODE] [-o \"OPTIONS\"]\n"), progname);
+ printf(_(" %s restart [-w] [-t secs] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n [-o \"OPTIONS\"]\n"), progname);
printf(_(" %s reload [-D DATADIR] [-s]\n"), progname);
printf(_(" %s status [-D DATADIR]\n"), progname);
printf(_(" %s kill SIGNALNAME PID\n"), progname);
#if defined(WIN32) || defined(__CYGWIN__)
printf(_(" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR]\n"
- " [-w] [-o \"OPTIONS\"]\n"), progname);
+ " [-w] [-t timeout] [-o \"OPTIONS\"]\n"), progname);
printf(_(" %s unregister [-N SERVICENAME]\n"), progname);
#endif
printf(_("\nCommon options:\n"));
printf(_(" -D, --pgdata DATADIR location of the database storage area\n"));
printf(_(" -s, --silent only print errors, no informational messages\n"));
+ printf(_(" -t secs seconds to wait when using -w option\n"));
printf(_(" -w wait until operation completes\n"));
printf(_(" -W do not wait until operation completes\n"));
printf(_(" --help show this help, then exit\n"));
{"mode", required_argument, NULL, 'm'},
{"pgdata", required_argument, NULL, 'D'},
{"silent", no_argument, NULL, 's'},
+ {"timeout", required_argument, NULL, 't'},
{"core-files", no_argument, NULL, 'c'},
{NULL, 0, NULL, 0}
};
/* process command-line options */
while (optind < argc)
{
- while ((c = getopt_long(argc, argv, "cD:l:m:N:o:p:P:sU:wW", long_options, &option_index)) != -1)
+ while ((c = getopt_long(argc, argv, "cD:l:m:N:o:p:P:st:U:wW", long_options, &option_index)) != -1)
{
switch (c)
{
case 's':
silent_mode = true;
break;
+ case 't':
+ wait_seconds = atoi(optarg);
+ break;
case 'U':
if (strchr(optarg, '\\'))
register_username = xstrdup(optarg);