From 87306184580c9c49717b00d48a2f9e717f21e0a8 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 13 Apr 2013 23:42:42 -0400 Subject: 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. --- contrib/start-scripts/linux | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib/start-scripts/linux') 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 -- cgit v1.2.3