mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
pg_ctl: Change default to wait for all actions
The different actions in pg_ctl had different defaults for -w and -W, mostly for historical reasons. Most users will want the -w behavior, so make that the default. Remove the -w option in most example and test code, so avoid confusion and reduce verbosity. pg_upgrade is not touched, so it can continue to work with older installations. Reviewed-by: Beena Emerson <memissemerson@gmail.com> Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
This commit is contained in:
@ -28,8 +28,7 @@ PGLOG="$PGDATA/serverlog"
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
# What to use to start up the postmaster. (If you want the script to wait
|
||||
# until the server has started, you could use "pg_ctl start -w" here.
|
||||
# But without -w, pg_ctl adds no value.)
|
||||
# until the server has started, you could use "pg_ctl start" here.)
|
||||
DAEMON="$prefix/bin/postmaster"
|
||||
|
||||
# What to use to shut down the postmaster
|
||||
@ -51,7 +50,7 @@ case $1 in
|
||||
su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
|
||||
;;
|
||||
restart)
|
||||
su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -w"
|
||||
su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
|
||||
su -l $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
|
||||
;;
|
||||
status)
|
||||
|
@ -60,8 +60,7 @@ PGLOG="$PGDATA/serverlog"
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
# What to use to start up the postmaster. (If you want the script to wait
|
||||
# until the server has started, you could use "pg_ctl start -w" here.
|
||||
# But without -w, pg_ctl adds no value.)
|
||||
# until the server has started, you could use "pg_ctl start" here.)
|
||||
DAEMON="$prefix/bin/postmaster"
|
||||
|
||||
# What to use to shut down the postmaster
|
||||
@ -102,7 +101,7 @@ case $1 in
|
||||
;;
|
||||
restart)
|
||||
echo -n "Restarting PostgreSQL: "
|
||||
su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -w"
|
||||
su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
|
||||
test -e "$PG_OOM_ADJUST_FILE" && echo "$PG_MASTER_OOM_SCORE_ADJ" > "$PG_OOM_ADJUST_FILE"
|
||||
su - $PGUSER -c "$DAEMON_ENV $DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
|
||||
echo "ok"
|
||||
|
@ -65,8 +65,7 @@ ROTATESEC="604800"
|
||||
PATH="$prefix/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
|
||||
# What to use to start up the postmaster. (If you want the script to wait
|
||||
# until the server has started, you could use "pg_ctl start -w" here.
|
||||
# But without -w, pg_ctl adds no value.)
|
||||
# until the server has started, you could use "pg_ctl start" here.)
|
||||
DAEMON="$prefix/bin/postmaster"
|
||||
|
||||
# What to use to shut down the postmaster
|
||||
|
Reference in New Issue
Block a user