Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6e414a17
Commit
6e414a17
authored
Nov 10, 2007
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pg_ctl -t/timeout parameter to control amount of time to wait for
start/shutdown.
parent
c6722d72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
doc/src/sgml/ref/pg_ctl-ref.sgml
doc/src/sgml/ref/pg_ctl-ref.sgml
+26
-3
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_ctl/pg_ctl.c
+10
-5
No files found.
doc/src/sgml/ref/pg_ctl-ref.sgml
View file @
6e414a17
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.4
3 2007/11/10 14:07:18
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.4
4 2007/11/10 21:48:51
momjian Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -21,9 +21,11 @@ PostgreSQL documentation
...
@@ -21,9 +21,11 @@ PostgreSQL documentation
<refsynopsisdiv>
<refsynopsisdiv>
<cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">start</arg>
<arg choice="plain">start</arg>
<arg>-w</arg>
<arg>-w</arg>
<arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-l <replaceable>filename</replaceable></arg>
<arg>-l <replaceable>filename</replaceable></arg>
...
@@ -31,9 +33,11 @@ PostgreSQL documentation
...
@@ -31,9 +33,11 @@ PostgreSQL documentation
<arg>-p <replaceable>path</replaceable></arg>
<arg>-p <replaceable>path</replaceable></arg>
<arg>-c</arg>
<arg>-c</arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">stop</arg>
<arg choice="plain">stop</arg>
<arg>-W</arg>
<arg>-W</arg>
<arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-m
<arg>-m
...
@@ -44,9 +48,11 @@ PostgreSQL documentation
...
@@ -44,9 +48,11 @@ PostgreSQL documentation
</group>
</group>
</arg>
</arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">restart</arg>
<arg choice="plain">restart</arg>
<arg>-w</arg>
<arg>-w</arg>
<arg>-t <replaceable>seconds</replaceable></arg>
<arg>-s</arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-c</arg>
<arg>-c</arg>
...
@@ -59,20 +65,24 @@ PostgreSQL documentation
...
@@ -59,20 +65,24 @@ PostgreSQL documentation
</arg>
</arg>
<arg>-o <replaceable>options</replaceable></arg>
<arg>-o <replaceable>options</replaceable></arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">reload</arg>
<arg choice="plain">reload</arg>
<arg>-s</arg>
<arg>-s</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">status</arg>
<arg choice="plain">status</arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">kill</arg>
<arg choice="plain">kill</arg>
<arg><replaceable>signal_name</replaceable></arg>
<arg><replaceable>signal_name</replaceable></arg>
<arg><replaceable>process_id</replaceable></arg>
<arg><replaceable>process_id</replaceable></arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">register</arg>
<arg choice="plain">register</arg>
<arg>-N <replaceable>servicename</replaceable></arg>
<arg>-N <replaceable>servicename</replaceable></arg>
...
@@ -80,11 +90,14 @@ PostgreSQL documentation
...
@@ -80,11 +90,14 @@ PostgreSQL documentation
<arg>-P <replaceable>password</replaceable></arg>
<arg>-P <replaceable>password</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-w</arg>
<arg>-w</arg>
<arg>-t <replaceable>seconds</replaceable></arg>
<arg>-o <replaceable>options</replaceable></arg>
<arg>-o <replaceable>options</replaceable></arg>
<sbr>
<sbr>
<command>pg_ctl</command>
<command>pg_ctl</command>
<arg choice="plain">unregister</arg>
<arg choice="plain">unregister</arg>
<arg>-N <replaceable>servicename</replaceable></arg>
<arg>-N <replaceable>servicename</replaceable></arg>
</cmdsynopsis>
</cmdsynopsis>
</refsynopsisdiv>
</refsynopsisdiv>
...
@@ -261,12 +274,22 @@ PostgreSQL documentation
...
@@ -261,12 +274,22 @@ PostgreSQL documentation
</listitem>
</listitem>
</varlistentry>
</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>
<varlistentry>
<term><option>-w</option></term>
<term><option>-w</option></term>
<listitem>
<listitem>
<para>
<para>
Wait for the start or shutdown to complete. T
imes out after
Wait for the start or shutdown to complete. T
he default wait time
60 seconds. This is the default
for shutdowns. A successful
is 60 seconds. This is the default option
for shutdowns. A successful
shutdown is indicated by removal of the <acronym>PID</acronym>
shutdown is indicated by removal of the <acronym>PID</acronym>
file. For starting up, a successful <command>psql -l</command>
file. For starting up, a successful <command>psql -l</command>
indicates success. <command>pg_ctl</command> will attempt to
indicates success. <command>pg_ctl</command> will attempt to
...
...
src/bin/pg_ctl/pg_ctl.c
View file @
6e414a17
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*
*
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.8
5 2007/10/31 10:55:25 petere
Exp $
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.8
6 2007/11/10 21:48:51 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1465,21 +1465,22 @@ do_help(void)
...
@@ -1465,21 +1465,22 @@ do_help(void)
printf
(
_
(
"%s is a utility to start, stop, restart, reload configuration files,
\n
"
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
);
"report the status of a PostgreSQL server, or signal a PostgreSQL process.
\n\n
"
),
progname
);
printf
(
_
(
"Usage:
\n
"
));
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 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 reload [-D DATADIR] [-s]
\n
"
),
progname
);
printf
(
_
(
" %s status [-D DATADIR]
\n
"
),
progname
);
printf
(
_
(
" %s status [-D DATADIR]
\n
"
),
progname
);
printf
(
_
(
" %s kill SIGNALNAME PID
\n
"
),
progname
);
printf
(
_
(
" %s kill SIGNALNAME PID
\n
"
),
progname
);
#if defined(WIN32) || defined(__CYGWIN__)
#if defined(WIN32) || defined(__CYGWIN__)
printf
(
_
(
" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR]
\n
"
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
);
printf
(
_
(
" %s unregister [-N SERVICENAME]
\n
"
),
progname
);
#endif
#endif
printf
(
_
(
"
\n
Common options:
\n
"
));
printf
(
_
(
"
\n
Common options:
\n
"
));
printf
(
_
(
" -D, --pgdata DATADIR location of the database storage area
\n
"
));
printf
(
_
(
" -D, --pgdata DATADIR location of the database storage area
\n
"
));
printf
(
_
(
" -s, --silent only print errors, no informational messages
\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 wait until operation completes
\n
"
));
printf
(
_
(
" -W do not wait until operation completes
\n
"
));
printf
(
_
(
" -W do not wait until operation completes
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
...
@@ -1592,6 +1593,7 @@ main(int argc, char **argv)
...
@@ -1592,6 +1593,7 @@ main(int argc, char **argv)
{
"mode"
,
required_argument
,
NULL
,
'm'
},
{
"mode"
,
required_argument
,
NULL
,
'm'
},
{
"pgdata"
,
required_argument
,
NULL
,
'D'
},
{
"pgdata"
,
required_argument
,
NULL
,
'D'
},
{
"silent"
,
no_argument
,
NULL
,
's'
},
{
"silent"
,
no_argument
,
NULL
,
's'
},
{
"timeout"
,
required_argument
,
NULL
,
't'
},
{
"core-files"
,
no_argument
,
NULL
,
'c'
},
{
"core-files"
,
no_argument
,
NULL
,
'c'
},
{
NULL
,
0
,
NULL
,
0
}
{
NULL
,
0
,
NULL
,
0
}
};
};
...
@@ -1657,7 +1659,7 @@ main(int argc, char **argv)
...
@@ -1657,7 +1659,7 @@ main(int argc, char **argv)
/* process command-line options */
/* process command-line options */
while
(
optind
<
argc
)
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:s
t:
U:wW"
,
long_options
,
&
option_index
))
!=
-
1
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -1704,6 +1706,9 @@ main(int argc, char **argv)
...
@@ -1704,6 +1706,9 @@ main(int argc, char **argv)
case
's'
:
case
's'
:
silent_mode
=
true
;
silent_mode
=
true
;
break
;
break
;
case
't'
:
wait_seconds
=
atoi
(
optarg
);
break
;
case
'U'
:
case
'U'
:
if
(
strchr
(
optarg
,
'\\'
))
if
(
strchr
(
optarg
,
'\\'
))
register_username
=
xstrdup
(
optarg
);
register_username
=
xstrdup
(
optarg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment