Skip to content

Commit fc9e8b2

Browse files
samrosesoedirgo
authored andcommitted
chore: mod stop_postgres for daemon
1 parent cf17ce0 commit fc9e8b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nix/tools/run-server.sh.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ start_postgres() {
5656
}
5757

5858
stop_postgres() {
59-
pg_ctl stop -D "$DATDIR" -m fast
59+
if [ "$DAEMONIZE" = true ]; then
60+
echo "PostgreSQL is running in daemon mode. Please stop it using pg_ctl."
61+
else
62+
pg_ctl stop -D "$DATDIR" -m fast
63+
fi
6064
}
6165

6266
trap 'stop_postgres' SIGINT SIGTERM
@@ -331,6 +335,7 @@ EOSQL
331335
fi
332336
fi
333337
echo "Shutting down PostgreSQL..."
338+
334339
stop_postgres
335340

336341
# Step 4: Restart PostgreSQL in the foreground (with log output visible) or as a daemon

0 commit comments

Comments
 (0)