On 10/1/20 4:01 AM, Pierre Labastie via blfs-dev wrote:
The postgresql boot script uses:
----
su - postgres -c '/usr/bin/pg_ctl start -W -D /srv/pgsql/data \
                          -l /srv/pgsql/data/logfile -o "-i" '
----
to start the server. The problem is that the -W option prevents the
command to exit with an error, even if the server is not started. From
the man page for pg_ctl:
--------
-W
        --no-wait
Do not wait for the operation to complete. This is the opposite of
the option -w.

If waiting is disabled, the requested action is triggered, but
there is no feedback about its success. In that case, the server
log file or an external monitoring system would have to be used to
check the progress and success of the operation.
-------

When updating to major version 13, the database has to be recreated
(see release notes), but I failed to do that, so the server could not
start... And the only failure was when shutting down the machine,
because the .pid file did not exist.

So I think the -W switch should be removed. Also, pg_ctl outputs
"server starting ...\n", so the green "success" is not aligned with the
"starting ..." line (not a big deal, but maybe  the "-s" (silent)
switch could be used...).

Will wait for your thoughts for a day or so, then commit those changes.

Pierre

I do agree that something needs to be changed here. As you mentioned above, there was no indication that the server failed to start, only that the pid file was missing when you tried to stop the server.
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to