Skip to content
Snippets Groups Projects
Commit e97d163c authored by Christoph Berg's avatar Christoph Berg :satellite:
Browse files

pg_ctlcluster: Create stats_temp_directory when missing.

parent 86e2ae5e
No related branches found
No related tags found
No related merge requests found
...@@ -562,7 +562,8 @@ sub check_pidfile_running { ...@@ -562,7 +562,8 @@ sub check_pidfile_running {
# Return a hash with information about a specific cluster. # Return a hash with information about a specific cluster.
# Arguments: <version> <cluster name> # Arguments: <version> <cluster name>
# Returns: information hash (keys: pgdata, port, running, logfile [unless it # Returns: information hash (keys: pgdata, port, running, logfile [unless it
# has a custom one], configdir, owneruid, ownergid, socketdir) # has a custom one], configdir, owneruid, ownergid, socketdir,
# statstempdir)
sub cluster_info { sub cluster_info {
error 'cluster_info must be called with <version> <cluster> arguments' unless $_[0] && $_[1]; error 'cluster_info must be called with <version> <cluster> arguments' unless $_[0] && $_[1];
...@@ -572,6 +573,7 @@ sub cluster_info { ...@@ -572,6 +573,7 @@ sub cluster_info {
$result{'pgdata'} = cluster_data_directory $_[0], $_[1], \%postgresql_conf; $result{'pgdata'} = cluster_data_directory $_[0], $_[1], \%postgresql_conf;
$result{'port'} = $postgresql_conf{'port'} || $defaultport; $result{'port'} = $postgresql_conf{'port'} || $defaultport;
$result{'socketdir'} = get_cluster_socketdir $_[0], $_[1]; $result{'socketdir'} = get_cluster_socketdir $_[0], $_[1];
$result{'statstempdir'} = $postgresql_conf{'stats_temp_directory'};
# if we can determine the running status with the pid file, prefer that # if we can determine the running status with the pid file, prefer that
if ($postgresql_conf{'external_pid_file'} && if ($postgresql_conf{'external_pid_file'} &&
......
...@@ -6,8 +6,9 @@ postgresql-common (146) UNRELEASED; urgency=low ...@@ -6,8 +6,9 @@ postgresql-common (146) UNRELEASED; urgency=low
+ On error, show tail of server log file. + On error, show tail of server log file.
+ When no command is given, open a shell. + When no command is given, open a shell.
* pg_createcluster: Add --createclusterconf and --environment options. * pg_createcluster: Add --createclusterconf and --environment options.
* pg_ctlcluster: Create stats_temp_directory when missing.
-- Christoph Berg <myon@debian.org> Thu, 27 Jun 2013 15:19:02 +0200 -- Christoph Berg <myon@debian.org> Mon, 01 Jul 2013 11:47:25 +0200
postgresql-common (145) unstable; urgency=low postgresql-common (145) unstable; urgency=low
......
...@@ -390,6 +390,12 @@ if ($action ne 'stop' && ! -d $info{'socketdir'}) { ...@@ -390,6 +390,12 @@ if ($action ne 'stop' && ! -d $info{'socketdir'}) {
'-o', $info{'owneruid'}, '-g', $info{'ownergid'}, $info{'socketdir'}; '-o', $info{'owneruid'}, '-g', $info{'ownergid'}, $info{'socketdir'};
} }
# recreate stats_temp_directory
if ($action ne 'stop' && $info{'statstempdir'} && ! -d $info{'statstempdir'}) {
system 'install', '-d', '-m', 750,
'-o', $info{'owneruid'}, '-g', $info{'ownergid'}, $info{'statstempdir'};
}
if ($> == 0) { if ($> == 0) {
# have the postmaster start with increased OOM killer protection; 9.1 and # have the postmaster start with increased OOM killer protection; 9.1 and
# later has builtin support for resetting the adjustment of child processes # later has builtin support for resetting the adjustment of child processes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment