Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_disk_space: handle relative symlinks for the WAL directory #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions check_postgres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package check_postgres;
use File::Temp qw/tempfile tempdir/;
File::Temp->safe_level( File::Temp::MEDIUM );
use Cwd;
use Cwd 'abs_path';
use Data::Dumper qw/Dumper/;
$Data::Dumper::Varname = 'POSTGRES';
$Data::Dumper::Indent = 2;
Expand Down Expand Up @@ -4995,6 +4996,12 @@ sub check_disk_space {
my $xlog = "$datadir/pg_xlog";
if (-l $xlog) {
my $linkdir = readlink($xlog);

## Handle relative symbolic links
if ($linkdir =~ m|^\.|) {
$linkdir = abs_path("$datadir/$linkdir");
}

$dir{$linkdir} = 1 if ! exists $dir{$linkdir};
}
}
Expand Down