| Summary: | dev-db/postgresql-server-9.0.4 init script 'status' returns incorrect error code | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Marcin Mirosław <bug> |
| Component: | Current packages | Assignee: | PgSQL Bugs <pgsql-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
Marcin Mirosław
2011-05-20 14:54:16 UTC
The "Reloading PostgreSQL configuration" is a copy/paste error.
As for the exit code:
postgres@atrus ~ $ pg_ctl status -D /var/lib/postgresql/9.0/data/ ; echo $?
pg_ctl: no server running
1
postgres@atrus ~ $ pg_ctl status -D /var/lib/postgresql/9.0/data/ ; echo $?
pg_ctl: server is running (PID: 26256)
/usr/lib/postgresql-9.0/bin/postgres "-D" "/var/lib/postgresql/9.0/data"
"-D" "/etc/postgresql-9.0/" "--data-directory=/var/lib/postgresql/9.0/data"
"--silent-mode=true"
0
postgres@atrus ~ $ pg_ctl status ; echo $?
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.
1
titan@atrus ~ $ pg_ctl status -D /var/lib/postgresql/9.0/data/ ; echo $?
pg_ctl: could not open PID file "/var/lib/postgresql/9.0/data/postmaster.pid": Permission denied
1
Don't know what to tell ya.
According to http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html exit code 1 (from init script) is incorrect. Imho, exit code from pg_ctl should be changed from 1 to 3. Aaron, i saw you've added patch to postgresql-9.1, have you got plans to do it for other versions? 02 Aug 2011; Aaron W. Swenson <titanofold@gentoo.org> +postgresql-server-8.2.21-r2.ebuild, +postgresql-server-8.3.15-r2.ebuild, +postgresql-server-8.4.8-r2.ebuild, +postgresql-server-9.0.4-r2.ebuild, +postgresql-server-9.1_beta3-r1.ebuild: Fixes bug 368177 and hopefully bug 341729 Thanks! |