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

pg_ctlcluster: Use "install" instead of File::Path to create

unix_socket_directory. (Introduced in 141, Closes: #710093)
parent 33d1953e
No related branches found
No related tags found
No related merge requests found
postgresql-common (145) UNRELEASED; urgency=low
* pg_ctlcluster: Use "install" instead of File::Path to create
unix_socket_directory. (Introduced in 141, Closes: #710093)
-- Christoph Berg <myon@debian.org> Sat, 01 Jun 2013 17:19:57 -0700
postgresql-common (144) unstable; urgency=low
* testsuite: Allow overriding the list of versions to test (-v).
......
......@@ -175,12 +175,6 @@ sub start {
}
}
if (! -d $info{'socketdir'}) {
print "Creating $info{'socketdir'} ...\n";
use File::Path qw(make_path);
make_path ($info{'socketdir'}, { owner => $info{'owneruid'}, group => $info{'ownergid'} });
}
$postmaster_opts .= ' ' . (join ' ', @postmaster_auxoptions);
($postmaster_opts) = $postmaster_opts =~ /(.*)/; # untaint
......@@ -390,6 +384,12 @@ if ($action ne 'stop' && $info{'logfile'} && ! -e $info{'logfile'}) {
close L;
}
# recreate /var/run/postgresql
if ($action ne 'stop' && ! -d $info{'socketdir'}) {
system 'install', '-d', '-m', 2775,
'-o', $info{'owneruid'}, '-g', $info{'ownergid'}, $info{'socketdir'};
}
if ($> == 0) {
# have the postmaster start with increased OOM killer protection; 9.1 and
# later has builtin support for resetting the adjustment of child processes
......@@ -409,6 +409,8 @@ if ($> == 0) {
change_ugid $info{'owneruid'}, $info{'ownergid'};
}
# we are running as the cluster owner now
if( $> != $info{'owneruid'} ) {
error 'You must run this program as the cluster owner ('.
(getpwuid $info{'owneruid'})[0].')';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment