summaryrefslogtreecommitdiff
path: root/contrib/start-scripts/linux
diff options
context:
space:
mode:
authorPeter Eisentraut2013-04-14 03:42:42 +0000
committerPeter Eisentraut2013-04-14 03:42:42 +0000
commit87306184580c9c49717b00d48a2f9e717f21e0a8 (patch)
treed39be0371ff7830870b353bda08a881b3cfe2802 /contrib/start-scripts/linux
parentba66752d278818b6b8797aec2e36cccf727db055 (diff)
pg_ctl: Add idempotent option
This changes the behavior of the start and stop actions to exit successfully if the server was already started or stopped. This changes the default behavior of the start action: Before, if the server was already running, it would print a message and succeed. Now, that situation will result in an error. When running in idempotent mode, no message is printed and pg_ctl exits successfully. It was considered to just make the idempotent behavior the default and only option, but pg_upgrade needs the old behavior.
Diffstat (limited to 'contrib/start-scripts/linux')
-rw-r--r--contrib/start-scripts/linux6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/start-scripts/linux b/contrib/start-scripts/linux
index b950cf512c3..03c6e503bc6 100644
--- a/contrib/start-scripts/linux
+++ b/contrib/start-scripts/linux
@@ -84,17 +84,17 @@ case $1 in
echo -n "Starting PostgreSQL: "
test x"$OOM_SCORE_ADJ" != x && echo "$OOM_SCORE_ADJ" > /proc/self/oom_score_adj
test x"$OOM_ADJ" != x && echo "$OOM_ADJ" > /proc/self/oom_adj
- su - $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
+ su - $PGUSER -c "$DAEMON -I -D '$PGDATA' &" >>$PGLOG 2>&1
echo "ok"
;;
stop)
echo -n "Stopping PostgreSQL: "
- su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
+ su - $PGUSER -c "$PGCTL stop -I -D '$PGDATA' -s -m fast"
echo "ok"
;;
restart)
echo -n "Restarting PostgreSQL: "
- su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -w"
+ su - $PGUSER -c "$PGCTL stop -I -D '$PGDATA' -s -m fast -w"
test x"$OOM_SCORE_ADJ" != x && echo "$OOM_SCORE_ADJ" > /proc/self/oom_score_adj
test x"$OOM_ADJ" != x && echo "$OOM_ADJ" > /proc/self/oom_adj
su - $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1