check_postgres
check_postgres copied to clipboard
check_disk_space: handle relative symlinks for the WAL directory
If the WAL directory (pg_xlog or pg_wal) resolves to a symbolic link, e.g. "../some-wal-dir", the check fails with an error like:
ERROR: Invalid result from command "/bin/df -kP "../some-wal-dir" 2>&1": /bin/df: "../some-wal-dir": No such file or directory
This patch checks for a relative symlink and extracts the actual WAL directory using abs_path().
Not sure if it's feasible to add a test for this, if it is please let me know.