Bug 703761

Summary: [postgres-sql] no ERROR message when service fails to start on 'no disk space'
Product: Red Hat Enterprise Linux 6 Reporter: Haim <hateya>
Component: postgresqlAssignee: Pavel Raiskup <praiskup>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2CC: bsettle, databases-maint, emesika, hhorak, lpeer, mgoldboi, praiskup, srevivo
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-25 08:00:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 947775    

Description Haim 2011-05-11 08:50:51 UTC
Description of problem:

Case: try to start /etc/init.d/postgresql 
Result: service fails to start - no ERROR message

[root@pink-dev ~]# bash /etc/init.d/postgresql start
Starting postgresql service:                               [FAILED]

Desired behavior: print the following error message: cannot start service - no space left of device.

Figured it out using sh -x /etc/init.d/postgresql start; 

[root@pink-dev pg_log]# 20530FATAL:  could not write lock file "postmaster.pid": No space left on device

[root@pink-dev pg_log]# rpm -q postgresql kernel 
postgresql-8.4.7-2.el6.x86_64
kernel-2.6.32-71.18.2.el6.x86_64

Comment 2 Tom Lane 2011-05-11 13:41:10 UTC
The FATAL message was presumably logged in postgres' normal log file.  I don't see any reason to do anything differently here, certainly not for the init script to concern itself with failure cases as narrow as that.

Comment 3 RHEL Program Management 2011-05-12 06:00:16 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 4 Haim 2011-05-12 09:01:13 UTC
(In reply to comment #2)
> The FATAL message was presumably logged in postgres' normal log file.  I don't
> see any reason to do anything differently here, certainly not for the init
> script to concern itself with failure cases as narrow as that.

actually, I don't think its a narrow case, specially, if you increase PG log verbosity, anyhow, simple error message would might save a lot of time, also, I didn't see this error on pg default log file under '/var/lib/pgsql/data/pg_log'.

Comment 6 Pavel Raiskup 2016-07-25 08:00:31 UTC
This is very unlikely to get fixed, we are in prod. phase 2, there is no patch
yet and on RHEL7 we use systemd, where this info is available:

[root@unused-4-107 praiskup]# service postgresql start
Redirecting to /bin/systemctl start  postgresql.service
Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.
[root@unused-4-107 praiskup]# service postgresql status
Redirecting to /bin/systemctl status  postgresql.service
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2016-07-25 09:58:16 CEST; 2s ago
  Process: 24284 ExecStart=/usr/libexec/postgresql-ctl start -D ${PGDATA} -s -w -t ${PGSTARTTIMEOUT} (code=exited, status=1/FAILURE)
  Process: 24279 ExecStartPre=/usr/libexec/postgresql-check-db-dir %N (code=exited, status=0/SUCCESS)

Jul 25 09:58:15 unused-4-107.brq.redhat.com systemd[1]: Starting PostgreSQL database server...
Jul 25 09:58:15 unused-4-107.brq.redhat.com postgresql-ctl[24284]: FATAL:  could not write lock file "postmaster.pid": No space left on device
Jul 25 09:58:16 unused-4-107.brq.redhat.com postgresql-ctl[24284]: pg_ctl: could not start server
Jul 25 09:58:16 unused-4-107.brq.redhat.com systemd[1]: postgresql.service: Control process exited, code=exited status=1
Jul 25 09:58:16 unused-4-107.brq.redhat.com systemd[1]: Failed to start PostgreSQL database server.
Jul 25 09:58:16 unused-4-107.brq.redhat.com systemd[1]: postgresql.service: Unit entered failed state.
Jul 25 09:58:16 unused-4-107.brq.redhat.com systemd[1]: postgresql.service: Failed with result 'exit-code'.