Bug 869290 - RFE: a way how services can extend the error message of "systemctl start" if they fail to start
Summary: RFE: a way how services can extend the error message of "systemctl start" if ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-23 13:42 UTC by Jan Pazdziora
Modified: 2017-10-18 07:43 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-18 07:43:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2012-10-23 13:42:54 UTC
Description of problem:

When I install postgresql-server and start the service for the first time, it fail and it fails to provide any helpful information about remediation of the situation.

Version-Release number of selected component (if applicable):

postgresql-server-9.1.6-1.fc17.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Run service postgresql start.
  
Actual results:

# service postgresql start
Redirecting to /bin/systemctl start  postgresql.service
Job failed. See system journal and 'systemctl status' for details.
# systemctl status postgresql.service
postgresql.service - PostgreSQL database server
	  Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
	  Active: failed (Result: exit-code) since Tue, 23 Oct 2012 15:36:19 +0200; 4min 21s ago
	 Process: 8109 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/postgresql.service

Only grepping /var/log/messages reveals the reason:

Oct 23 15:34:33 ditustat systemd[1]: postgresql.service: control process exited, code=exited status=1
Oct 23 15:34:33 ditustat systemd[1]: Unit postgresql.service entered failed state.
Oct 23 15:36:19 ditustat postgresql-check-db-dir[8109]: "/var/lib/pgsql/data" is missing or empty.
Oct 23 15:36:19 ditustat postgresql-check-db-dir[8109]: Use "postgresql-setup initdb" to initialize the database cluster.
Oct 23 15:36:19 ditustat postgresql-check-db-dir[8109]: See /usr/share/doc/postgresql-9.1.6/README.rpm-dist for more information.
Oct 23 15:36:19 ditustat systemd[1]: postgresql.service: control process exited, code=exited status=1


Expected results:

In previous versions, the process would be like this:

# service postgresql start
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[FAILED]

I would expect something similar even under systemd, or for systemctl status to show the hint. Searching for clues in /var/log/messages is not admin friendly.

Additional info:

Comment 1 Tom Lane 2012-10-23 14:04:39 UTC
This is really a systemd enhancement request: there is not (to my knowledge) any approved way for a daemon to provide any feedback to a manual service-start operation.  I concur that there ought to be, but previous complaints about this haven't borne fruit.  Reassigning to systemd to see what they say.

Comment 2 Michal Schmidt 2012-10-23 14:18:18 UTC
The messages are supposed to be shown in the output of systemctl status. If they aren't, it's due to a known race condition. The proper fix requires a new kernel feature.

See the paragraph about SCM_CGROUPS in the Plumbers' wishlist:
https://docs.google.com/document/pub?id=1RmJrtIoTnivkmR9KCqfJNBnEll4X9Jtu0xj5w6hFGs8

See also bug 820448 and bug 850556.

Comment 3 Jan Pazdziora 2012-10-23 14:29:40 UTC
(In reply to comment #2)
> The messages are supposed to be shown in the output of systemctl status. If
> they aren't, it's due to a known race condition. The proper fix requires a
> new kernel feature.

What is the kernel bugzilla which tracks this?

> See also bug 820448 and bug 850556.

These are both bugzillas on the systemd component.

Comment 4 Tom Lane 2012-10-23 14:44:53 UTC
So, as a workaround until something is done about that, we could put a "sleep 2" or so in the scripts that emit these messages?

Comment 5 Fedora End Of Life 2013-07-04 03:35:51 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Jan Pazdziora 2013-07-04 07:26:31 UTC
Behaviour is still the same with systemd-204-9.fc19.x86_64 and postgresql-server-9.2.4-1.fc19.x86_64.

Comment 7 Jan Pazdziora 2017-10-18 07:43:57 UTC
Closing.


Note You need to log in before you can comment on or make changes to this bug.