postgres init script fails uncleanly if cluster directory is missing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
postgresql-common (Ubuntu) |
Fix Released
|
Low
|
Martin Pitt |
Bug Description
Binary package hint: postgresql-common
On this particular setup, the cluster home directory /var/lib/postgresql is mounted to its own partition.
By accident, the directory wasn't mounted when I tried to launch postgres. Instead of a precise error message notifying me about the problem, I got a heap of perl error messages. While it's pure cosmetics, I think the scripts should check for basic errors like that and not bail out showing a bunch of perl errors.
Steps to reproduce:
- Create a postgres-cluster
- Remove the parent directory of said cluster (or unmount its partition)
- Try to launch postgres.
Expected tesults:
- Error-Message explaining the problem
Actual results:
root@vmmepha:~# /etc/init.
* Starting PostgreSQL 8.3 database server
* Use of uninitialized value in getpwuid at /usr/bin/
Use of uninitialized value in getgrgid at /usr/bin/
Use of uninitialized value in concatenation (.) or string at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in numeric eq (==) at /usr/share/
Use of uninitialized value in scalar assignment at /usr/share/
Use of uninitialized value in scalar assignment at /usr/share/
Use of uninitialized value in numeric ne (!=) at /usr/share/
Use of uninitialized value in numeric ne (!=) at /usr/share/
Use of uninitialized value in numeric ne (!=) at /usr/bin/
pg_controldata: could not open file "/var/lib/
Error: Could not parse locale out of pg_controldata output
...fail!
$ lsb_release -rd
Description: Ubuntu hardy (development branch)
Release: 8.04
IMHO, the "could not open file "/var/lib/ postgresql/ 8.3/main/ global/ pg_control" for reading: No such file or directory" message is clear enough. It would be nice to suppress all the perl warnings, of course.