Commit 85ad3eb5 authored by Christoph Berg's avatar Christoph Berg

Replace most occurrences of "postmaster" by "postgres". Notable leftover is...

Replace most occurrences of "postmaster" by "postgres". Notable leftover is the postmaster.1.gz leader of the manpages alternatives group.
parent 680cbd02
......@@ -435,7 +435,7 @@ sub get_program_path {
return '';
}
# Check whether a postmaster server is running at the specified port.
# Check whether a postgres server is running at the specified port.
# Arguments: <version> <cluster> <port>
sub cluster_port_running {
die "port_running: invalid port $_[2]" if $_[2] !~ /\d+/;
......@@ -560,11 +560,11 @@ sub read_pidfile {
}
}
# Check whether a pid file is present and belongs to a running postmaster.
# Check whether a pid file is present and belongs to a running postgres.
# Returns undef if it cannot be determined
# Arguments: <pid file path>
sub check_pidfile_running {
# postmaster does not clean up the PID file when it stops, and it is
# postgres does not clean up the PID file when it stops, and it is
# not world readable, so only its absence is a definitive result; if it
# is present, we need to read it and check the PID, which will only
# work as root
......@@ -579,7 +579,7 @@ sub check_pidfile_running {
my $process = <PS>;
chomp $process if defined $process;
close PS;
if (defined $process and ($process eq 'postmaster' or $process eq 'postgres')) {
if (defined $process and ($process eq 'postgres')) {
return 1;
} else {
return 0;
......
......@@ -35,7 +35,7 @@ be a high priority with upstream developers. </p>
<p>It is possible to run different versions of PostgreSQL simultaneously, and
indeed to run the same version on separate database clusters simultaneously.
To do so, each postmaster must listen on a different port, so each client
To do so, each postgres instance must listen on a different port, so each client
must specify the correct port. By having two separate
versions of the PostgreSQL packages installed simultaneously, it is
simple to do database upgrades by dumping from the old version and
......@@ -95,7 +95,7 @@ default version/cluster and database; overrides
(<code>pg_ctlcluster</code> is not allowed).</li>
<li>optionally <code>pg_ctl.conf</code>: options to be passed to pg_ctl.</li>
<li>optionally a symbolic link <code>log</code> which points to
the postmaster log file. Defaults to
the postgres log file. Defaults to
<code>/var/log/postgresql/postgresql-</code><i>version</i><code>-</code><i>cluster</i><code>.conf</code>.
Explicitly setting <code>log_directory</code> and/or
<code>log_filename</code> in <code>postgresql.conf</code>
......@@ -120,7 +120,7 @@ default version/cluster and database; overrides
<tr><td><code>/usr/bin/<i>program</i></code></td> <td>symbolic links to pg_wrapper, for all client programs</td></tr>
<tr><td><code>/usr/bin/pg_lsclusters</code></td> <td>list all available clusters with their status and configuration</td></tr>
<tr><td><code>/usr/bin/pg_createcluster</code></td><td>wrapper for <code>initdb</code>, sets up the necessary configuration structure</td></tr>
<tr><td><code>/usr/bin/pg_ctlcluster</code></td><td>wrapper for <code>pg_ctl</code>, control the cluster <b>postmaster</b> server</td></tr>
<tr><td><code>/usr/bin/pg_ctlcluster</code></td><td>wrapper for <code>pg_ctl</code>, control the cluster <b>postgres</b> server</td></tr>
<tr><td><code>/usr/bin/pg_upgradecluster</code></td><td>Upgrade a cluster to a newer major version.</td></tr>
<tr><td><code>/usr/bin/pg_dropcluster</code></td><td>remove a cluster and its configuration</td></tr>
</table>
......@@ -136,7 +136,7 @@ name, thus reintroducing the default upstream behaviour.</p>
<h3>/etc/init.d/postgresql</h3>
<p>This script now handles the postmaster server processes for each version and
<p>This script now handles the postgres server processes for each version and
all their clusters. However, most of the actual work is done by the new
<code>pg_ctlcluster</code> program.</p>
......
......@@ -18,5 +18,5 @@
[ `id -u` = 0 ] || SUDO=sudo
$SUDO /etc/init.d/postgresql stop
$SUDO killall pg_autovacuum postmaster postgres
$SUDO killall pg_autovacuum postgres
$SUDO rm -rf /etc/postgresql /var/lib/postgresql/ /var/log/postgresql/* /tmp/postgresql-testsuite/ /var/run/postgresql/*
......@@ -9,6 +9,8 @@ postgresql-common (178) UNRELEASED; urgency=medium
(Closes: #614374, #838812)
* pg_upgradecluster, pg_renamecluster: Update cluster_name.
* Rebuild upgrades libreadline to 7 in unstable. (Closes: #845356)
* Replace most occurrences of "postmaster" by "postgres". Notable leftover
is the postmaster.1.gz leader of the manpages alternatives group.
[ Martin Pitt ]
* debian/supported-versions: Add Ubuntu 17.04.
......
......@@ -16,7 +16,7 @@ do_ctl_all() {
[ "$2" ] || { echo "Error: invalid version '$2'" >&2; exit 1; }
[ -d "/etc/postgresql/$2" ] || return 0
[ "$(ls /etc/postgresql/$2)" ] || return 0
[ -x "$PGBINROOT$2/bin/postmaster" ] || return 0
[ -x "$PGBINROOT$2/bin/postgres" ] || return 0
status=0
log_daemon_msg "$3"
......
......@@ -543,7 +543,7 @@ if ($want_ssl && $newcluster && -e "$PgCommon::common_confdir/root.crl") {
}
# create default (empty) environment file
my $defaultenv = "# environment variables for postmaster process
my $defaultenv = "# environment variables for postgres processes
# This file has the same syntax as postgresql.conf:
# VARIABLE = simple_value
# VARIABLE2 = 'any value!'
......@@ -622,7 +622,7 @@ B<pg_createcluster> [I<options>] I<version> I<name> [B<--> I<initdb options>]
=head1 DESCRIPTION
B<pg_createcluster> creates a new PostgreSQL server cluster (i. e. a
collection of databases served by a L<postmaster(1)> instance) and
collection of databases served by a L<postgres(1)> instance) and
integrates it into the multi-version/multi-cluster architecture of the
B<postgresql-common> package.
......@@ -703,7 +703,7 @@ C</var/lib/postgresql/>I<version>C</>I<cluster>.
=item B<-s> I<dir>, B<--socketdir=>I<dir>
Explicitly set the directory where the L<postmaster(1)> server stores the Unix
Explicitly set the directory where the L<postgres(1)> server stores the Unix
socket for local connections. Defaults to C</var/run/postgresql/> for clusters
owned by the user B<postgres>, and C</tmp> for clusters owned by other users.
Please be aware that C</tmp> is an unsafe directory since everybody can create
......@@ -712,7 +712,7 @@ not exist, it is created with appropriate permissions.
=item B<-l> I<path>, B<--logfile=>I<path>
Explicitly set the path for the L<postmaster(1)> server log file. Defaults to
Explicitly set the path for the L<postgres(1)> server log file. Defaults to
C</var/log/postgresql/postgresql->I<version>C<->I<cluster>C<.log>.
=item B<--locale=>I<locale>
......@@ -798,7 +798,7 @@ will be left untouched.
=head1 STARTUP CONTROL
The C<start.conf> file in the cluster configuration directory controls the
start/stop behavior of that cluster's postmaster process. The file can contain
start/stop behavior of that cluster's postgres process. The file can contain
comment lines (started with '#'), empty lines, and must have exactly one
line with one of the following keywords:
......@@ -806,7 +806,7 @@ line with one of the following keywords:
=item B<auto>
The postmaster process is started/stopped automatically in the init script.
The postgres process is started/stopped automatically in the init script.
When running from B<systemd>, the cluster is started/stopped when
B<postgresql.service> is started/stopped.
......@@ -814,7 +814,7 @@ This is also the default if the file is missing.
=item B<manual>
The postmaster process is not handled by the init script, but manually
The postgres process is not handled by the init script, but manually
controlling the cluster with L<pg_ctlcluster(1)> is permitted.
When running from B<systemd>, the cluster is not started automatically when
......@@ -826,7 +826,7 @@ using B<systemctl start postgresql@>I<version>B<->I<cluster>.
Neither the init script, L<pg_ctlcluster(1)>, nor B<postgresql@.service> are permitted to start/stop the
cluster. Please be aware that this will not stop the cluster owner from calling
lower level tools to control the postmaster process; this option is only meant
lower level tools to control the postgres process; this option is only meant
to prevent accidents during maintenance, not more.
=back
......
......@@ -26,7 +26,7 @@ use PgCommon;
use Fcntl 'SEEK_SET';
my ($version, $cluster, $pg_ctl, $force);
my (@postmaster_auxoptions, @pg_ctl_opts_from_cli);
my (@postgres_auxoptions, @pg_ctl_opts_from_cli);
my (%postgresql_conf, %info);
my $mode = 'smart'; # default shutdown mode
my $foreground = 0; # don't daemonize, use postgres instead of pg_ctl
......@@ -140,18 +140,18 @@ sub start {
# PG_OOM_ADJUST_VALUE defaults to 0, but can be overridden here
}
my $postmaster_opts = '';
my $postgres_opts = '';
my $usd = $version >= 9.3 ? 'unix_socket_directories' : 'unix_socket_directory';
if (!(PgCommon::get_conf_value $version, $cluster, 'postgresql.conf', $usd)) {
$postmaster_opts .= "-c $usd=\"$info{'socketdir'}\"";
$postgres_opts .= "-c $usd=\"$info{'socketdir'}\"";
}
$postmaster_opts .= " -c config_file=\"$cdir/postgresql.conf\"";
$postgres_opts .= " -c config_file=\"$cdir/postgresql.conf\"";
if (!(PgCommon::get_conf_value $version, $cluster, 'postgresql.conf', 'hba_file')) {
$postmaster_opts .= " -c hba_file=\"$cdir/pg_hba.conf\"";
$postgres_opts .= " -c hba_file=\"$cdir/pg_hba.conf\"";
}
if (!(PgCommon::get_conf_value $version, $cluster, 'postgresql.conf', 'ident_file')) {
$postmaster_opts .= " -c ident_file=\"$cdir/pg_ident.conf\"";
$postgres_opts .= " -c ident_file=\"$cdir/pg_ident.conf\"";
}
if ((-d '/var/run/postgresql') && !defined (PgCommon::get_conf_value $version, $cluster, 'postgresql.conf', 'external_pid_file')) {
......@@ -166,12 +166,12 @@ sub start {
$vrp_writable = -w '/var/run/postgresql';
}
if ($vrp_writable) {
$postmaster_opts .= " -c external_pid_file=\"/var/run/postgresql/$version-$cluster.pid\"";
$postgres_opts .= " -c external_pid_file=\"/var/run/postgresql/$version-$cluster.pid\"";
}
}
$postmaster_opts .= ' ' . (join ' ', @postmaster_auxoptions);
($postmaster_opts) = $postmaster_opts =~ /(.*)/; # untaint
$postgres_opts .= ' ' . (join ' ', @postgres_auxoptions);
($postgres_opts) = $postgres_opts =~ /(.*)/; # untaint
if ($foreground) {
if ($stdlog and $info{'logfile'}) {
......@@ -179,7 +179,7 @@ sub start {
dup2(POSIX::open($info{logfile}, POSIX::O_WRONLY|POSIX::O_APPEND), 2);
}
my $postgres = get_program_path 'postgres', $version;
exec '/bin/sh', '-c', "exec $postgres $postmaster_opts" or
exec '/bin/sh', '-c', "exec $postgres $postgres_opts" or
error "Executing $postgres failed: $!"
}
......@@ -199,7 +199,7 @@ sub start {
push @options, split(' ', $pg_ctl_opts_from_file{'pg_ctl_options'})
if defined $pg_ctl_opts_from_file{'pg_ctl_options'} and $pg_ctl_opts_from_file{'pg_ctl_options'} ne '';
push @options, ('-s', '-o', $postmaster_opts);
push @options, ('-s', '-o', $postgres_opts);
if (fork) {
wait;
......@@ -322,7 +322,7 @@ sub promote {
my ($skip_systemctl_redirect, $bindir);
exit 1 unless GetOptions ('o|options=s' => \@postmaster_auxoptions,
exit 1 unless GetOptions ('o|options=s' => \@postgres_auxoptions,
'f|force' => \$force,
'm|mode=s' => \$mode,
'foreground' => \$foreground,
......@@ -403,7 +403,7 @@ if (not $skip_systemctl_redirect and getppid() != 1 and # not run from init
my $unit_active = $? == 0;
# if extra options are given, proceed with pg_ctlcluster with a warning
if (@postmaster_auxoptions != 0 or @pg_ctl_opts_from_cli != 0 or $bindir) { # extra options given
if (@postgres_auxoptions != 0 or @pg_ctl_opts_from_cli != 0 or $bindir) { # extra options given
print "Notice: extra pg_ctl/postgres options given, bypassing systemctl for $action operation\n" if (-t 1);
# if we are root, redirect to systemctl unless stopping a cluster running outside systemd
} elsif ($> == 0) {
......
......@@ -50,7 +50,7 @@ if (cluster_exists $version, $cluster) {
error 'could not stop server, aborting';
}
} else {
print STDERR "warning: corrupted cluster: data directory does not exist any more, but server is still running; you have to manually kill the postmaster process\n";
print STDERR "warning: corrupted cluster: data directory does not exist any more, but server is still running; you have to manually kill the postgres process\n";
}
} else {
error 'This cluster is still running. Stop it or supply the --stop option';
......
......@@ -211,7 +211,7 @@ sub disable_connections {
close F;
}
# Restore original pg_hba.conf, but do not restart postmaster.
# Restore original pg_hba.conf, but do not restart postgres.
# Arguments: <version> <cluster>
sub enable_connections {
my $hba = "$PgCommon::confroot/$_[0]/$_[1]/pg_hba.conf";
......@@ -751,7 +751,7 @@ B<pg_upgradecluster> [B<-v> I<newversion>] I<oldversion> I<name> [I<newdatadir>]
=head1 DESCRIPTION
B<pg_upgradecluster> upgrades an existing PostgreSQL server cluster (i. e. a
collection of databases served by a B<postmaster> instance) to a new version
collection of databases served by a B<postgres> instance) to a new version
specified by I<newversion> (default: latest available version). The
configuration files of the old version are copied to the new cluster and
adjusted for the new version. The new cluster is set up to use data page
......
# Check that no clusters and postmasters are present for this test.
# Check that no clusters and postgres processes are present for this test.
use strict;
use Test::More tests => 10;
......
......@@ -30,15 +30,15 @@ sub check_major {
ok_dir '/var/run/postgresql/', ["$v-main.pid", "$v-main.pg_stat_tmp"], 'Pid File is in /var/run/postgresql/';
}
# verify that exactly one postmaster is running
my @pm_pids = pidof (($v >= '8.2') ? 'postgres' : 'postmaster');
is $#pm_pids, 0, 'Exactly one postmaster process running';
# verify that exactly one postgres master is running
my @pm_pids = pidof ('postgres');
is $#pm_pids, 0, 'Exactly one postgres master process running';
# check environment
my %safe_env = qw/LC_ALL 1 LC_CTYPE 1 LANG 1 PWD 1 PGLOCALEDIR 1 PGSYSCONFDIR 1 PG_GRANDPARENT_PID 1 PG_OOM_ADJUST_FILE 1 PG_OOM_ADJUST_VALUE 1 SHLVL 1 PGDATA 1 _ 1/;
my %env = pid_env $pm_pids[0];
foreach (keys %env) {
fail "postmaster has unsafe environment variable $_" unless exists $safe_env{$_};
fail "postgres has unsafe environment variable $_" unless exists $safe_env{$_};
}
# activate external_pid_file
......@@ -52,8 +52,8 @@ sub check_major {
is_program_out 0, "pg_ctlcluster $v main restart", 0, '',
'cluster restarts with new environment file';
@pm_pids = pidof (($v >= '8.2') ? 'postgres' : 'postmaster');
is $#pm_pids, 0, 'Exactly one postmaster process running';
@pm_pids = pidof ('postgres');
is $#pm_pids, 0, 'Exactly one postgres master process running';
%env = pid_env $pm_pids[0];
is $env{'PGEXTRAVAR1'}, '1', 'correct value of PGEXTRAVAR1 in environment';
is $env{'PGEXTRAVAR2'}, 'foo bar ', 'correct value of PGEXTRAVAR2 in environment';
......@@ -144,9 +144,9 @@ sub check_major {
PgCommon::disable_conf_value $v, 'main', 'postgresql.conf', 'log_filename', '';
unlink "/etc/postgresql/$v/main/log";
# verify that the postmaster does not have an associated terminal
# verify that processes do not have an associated terminal
unlike_program_out 0, 'ps -o tty -U postgres h', 0, qr/tty|pts/,
'postmaster processes do not have an associated terminal';
'postgres processes do not have an associated terminal';
# verify that SSL is enabled (which should work for user postgres in a
# default installation)
......
......@@ -156,7 +156,7 @@ like_program_out 'nobody', 'pg_lsclusters -h', 0,
kill 9, $psql;
waitpid $psql, 0;
# now that the connection went away, postmaster shuts down; so restart it
# now that the connection went away, postgres shuts down; so restart it
# properly
system "pg_ctlcluster $MAJORS[0] upgr stop";
sleep 5;
......
......@@ -30,9 +30,8 @@ like_program_out $owner, 'pg_lsclusters -h', 0,
qr/^$v\s+main\s+5432\s+online\s+$owner/,
'pg_lsclusters shows running cluster';
my $master_process = ($v >= '8.2') ? 'postgres' : 'postmaster';
like ((ps $master_process), qr/^$owner.*bin\/$master_process .*\/var\/lib\/postgresql\/$v\/main/m,
"$master_process is running as user $owner");
like ((ps 'postgres'), qr/^$owner.*bin\/postgres .*\/var\/lib\/postgresql\/$v\/main/m,
"postgres is running as user $owner");
is_program_out $owner, 'ls /tmp/.s.PGSQL.*', 0, "/tmp/.s.PGSQL.5432\n/tmp/.s.PGSQL.5432.lock\n", 'socket is in /tmp';
......@@ -100,7 +99,7 @@ if ($#MAJORS > 0) {
# Check proper cleanup
is ((system "pg_dropcluster $v main --stop"), 0, 'pg_dropcluster');
is_program_out $owner, 'pg_lsclusters -h', 0, '', 'No clusters left';
is ((ps $master_process), '', "No $master_process processes left");
is ((ps 'postgres'), '', "No postgres processes left");
check_clean;
......
......@@ -99,7 +99,7 @@ sub ps {
}
# Return array of pids that match the given command name (we require a leading
# slash so the postmaster childs are filtered out)
# slash so the postgres children are filtered out)
sub pidof {
my $prg = shift;
open F, '-|', 'ps', 'h', '-C', $prg, '-o', 'pid,cmd' or die "open: $!";
......@@ -221,11 +221,11 @@ sub unlike_program_out {
}
# Check that all PostgreSQL related directories are empty and no
# postmaster processes are running. Should be called at the end
# postgres processes are running. Should be called at the end
# of all tests. Does 10 tests.
sub check_clean {
is (`pg_lsclusters -h`, '', 'No existing clusters');
is ((ps 'postmaster'), '', 'No postmaster processes left behind');
pass ''; # was postmaster
is ((ps 'postgres'), '', 'No postgres processes left behind');
pass ''; # this was pg_autovacuum in the past, which is obsolete
......
......@@ -10,9 +10,8 @@
# When pg_wrapper scans this file, the first matching line is used.
# It is a good idea to provide a default explicitly, with a final line
# where both user and group are set to "*". If there is no default,
# the implicit default is to connect to the cluster whose postmaster
# is listening on port 5432 and to the database matching the user's
# login name.
# the implicit default is to connect to the cluster listening on
# port 5432 and to the database matching the user's login name.
#
# In the context of this file, user and group refer to the Unix login
# or group, not to PostgreSQL users and groups.
......
......@@ -13,8 +13,8 @@ good idea to provide a default explicitly, with a final line where both
user and group are set to
.BR * .
If there is no default, the implicit default is to connect to the cluster whose
postmaster is listening on port 5432 and to the database matching the user's
If there is no default, the implicit default is to connect to the cluster
listening on port 5432 and to the database matching the user's
login name.
.SH FORMAT
......
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