Commit 5914b30d authored by Christoph Berg's avatar Christoph Berg

pg_ctlcluster: Document --skip-systemctl-redirect, and skip redirect if --foreground is requested.

parent 21cf7065
......@@ -5,6 +5,8 @@ postgresql-common (200) UNRELEASED; urgency=medium
* pg_upgradecluster: Deprecate 'replacement_sort_tuples' in version 11.
* pg_ctlcluster: Die early if logfile is not available. (Closes: #891234)
* pg_ctlcluster: Document --skip-systemctl-redirect, and skip redirect if
--foreground is requested.
* pg_dropcluster: Silence warning if data_directory is already gone.
Spotted by Jean-Christophe Arnu, merci!
......@@ -382,6 +382,7 @@ if (($< == 0 or $> == 0) and $info{'configuid'} != 0 and
# redirect the request through systemd
if (not $skip_systemctl_redirect and getppid() != 1 and # not run from init
-d '/run/systemd/system' and not exists $ENV{_SYSTEMCTL_SKIP_REDIRECT} and # systemd is running
not $foreground and # foreground operation not requested
not exists $ENV{'PG_CLUSTER_CONF_ROOT'} and # not handling user clusters
$action =~ /^(start|stop|restart)$/ # redirect only these actions
) {
......@@ -576,6 +577,13 @@ Start B<postgres> in foreground, without daemonizing via B<pg_ctl>.
When B<--foreground> is in use, redirect stderr to the standard logfile in
C</var/log/postgresql/>. (Default when not run in foreground.)
=item B<--skip-systemctl-redirect>
When running as root, B<pg_ctlcluster> redirects actions to B<systemctl> so
running clusters are properly supervised by B<systemd>. This option skips the
redirect; it is used in the B<postgresql@.service> unit file. The redirect is
also skipped if additional B<postgres> or B<pg_ctl> options are provided.
=item B<--bindir> I<directory>
Path to B<pg_ctl>. (Default is C</usr/lib/postgresql/>I<version>C</bin>.)
......@@ -2,10 +2,8 @@ systemd unit files for PostgreSQL on Debian/Ubuntu
Each cluster is run as a separate service, called postgresql@version/name.
As systemd prefers processes to not daemonize, pg_ctlcluster is invoked with
--foreground. Logging still goes to /var/log/postgresql. (If you prefer the
systemd journal, remove --stdlog from ExecStart postgresql@.service, or
configure the logging_collector.)
pg_ctlcluster is invoked with --skip-systemctl-redirect. Logging still goes to
There is a parent service called postgresql.service, that starts/stops/restarts/
reloads all individual services that are configured as "auto" in
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment