RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 800416 - postgresql doesn't start
Summary: postgresql doesn't start
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: postgresql
Version: 7.0
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Tom Lane
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 802465 816135 839713
TreeView+ depends on / blocked
 
Reported: 2012-03-06 13:16 UTC by Martin Cermak
Modified: 2013-07-03 03:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-03 02:56:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Cermak 2012-03-06 13:16:21 UTC
Description of problem:


  I'm performing a quick check for rhel6 and rhel7 services. On rhel7 I'm
  using the old "service" command syntax, which is provided for backwards
  compatibility. I assume that if service can start, get status and stop
  on rhel6, it should work in a similar way on rhel7.

  Testing performed using systemd-37-16.el7

  From this point of view I found a regression in postgresql:

# service postgresql start; service postgresql status; service postgresql stop; rpm -q postgresql-server;
Starting postgresql service:                               [  OK  ]
postmaster (pid  11724) is running...
Stopping postgresql service:                               [  OK  ]
postgresql-server-8.4.9-1.el6_1.1.x86_64

2# service postgresql start; service postgresql status; service postgresql stop; rpm -q postgresql-server;
Redirecting to /bin/systemctl  start postgresql.service
Job failed. See system logs and 'systemctl status' for details.
Redirecting to /bin/systemctl  status postgresql.service
postgresql.service - PostgreSQL database server
          Loaded: loaded (/lib/systemd/system/postgresql.service; disabled)
          Active: failed since Tue, 06 Mar 2012 13:15:26 -0500; 182ms ago
         Process: 15584 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
          CGroup: name=systemd:/system/postgresql.service
Redirecting to /bin/systemctl  stop postgresql.service
postgresql-server-9.1.1-1.el7.x86_64

Comment 1 Tom Lane 2012-03-06 14:49:05 UTC
So what's in the system log and/or postgresql log?

Comment 2 Martin Cermak 2012-03-06 16:03:07 UTC
Mar  6 10:58:15 dhcp-24-224 pg_ctl[4766]: postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": No such file or directory


How to test:

have a clean rhel7 minimal install
yum install -y postgresql-server
service postgresql initdb
service postgresql {start,status,stop}

This works on rhel6, whereas on rhel7 it doesn't.

Comment 3 Tom Lane 2012-03-06 17:20:46 UTC
"service postgresql initdb" doesn't work anymore under systemd.  That's a systemd shortcoming, not much  I can do about it ... but it'd be nice if they at least told you it wasn't doing anything.

Comment 4 Bill Nottingham 2012-03-09 22:10:06 UTC
It does:

$ service messagebus frobozz
Redirecting to /bin/systemctl  frobozz messagebus.service
Unknown operation frobozz

This seems to be NOTABUG?

Comment 5 Martin Cermak 2012-03-13 13:33:35 UTC
What about initializing the database during the first service run?

Comment 6 Tom Lane 2012-03-13 14:03:52 UTC
(In reply to comment #5)
> What about initializing the database during the first service run?

No.  It's dangerous.  The separate action for initdb is an upstream recommendation that I don't intend to break.

Comment 7 Tom Lane 2012-03-13 23:00:18 UTC
After poking at this some more, I found out that systemd's "service" command will redirect nonstandard commands to an init script without complaint.  I'm just about certain that that did not work six months ago when we decided we needed to invent postgresql-setup.  But it seems to work OK now in F16 and up, which means we can fix this by resurrecting the postgresql rc.d file.  I'm still going to only document the usage of postgresql-setup, but for anybody with "service postgresql initdb" wired into their fingertips, it'll continue to work like it did before.

Comment 8 Martin Cermak 2012-03-14 08:00:11 UTC
That sounds like a good message for anybody with "service postgresql initdb" wired into their fingertips and for me too. But I'm not sure if you are allowed to have the rc.d file in a single package along with the systemd unit:

http://fedoraproject.org/wiki/Packaging:Systemd#Unit_Files

Comment 9 Tom Lane 2012-03-14 13:57:29 UTC
(In reply to comment #8)
> http://fedoraproject.org/wiki/Packaging:Systemd#Unit_Files

I think that guideline applies to non-stub initscripts.  Of course, if you'd rather I closed this NOTABUG, then we don't need it.

Comment 10 Karel Volný 2012-03-15 14:50:45 UTC
(In reply to comment #7)
> I'm still going to only document the usage of postgresql-setup, but for
> anybody with "service postgresql initdb" wired into their fingertips, it'll
> continue to work like it did before.

thinking about it ... is it too late to throw away this postgresql-setup if the old way works?

- why to introduce this ugly hack to workaround (now) non-existant problem?

Comment 11 Tom Lane 2012-03-15 15:00:39 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > I'm still going to only document the usage of postgresql-setup, but for
> > anybody with "service postgresql initdb" wired into their fingertips, it'll
> > continue to work like it did before.
> 
> thinking about it ... is it too late to throw away this postgresql-setup if the
> old way works?

postgresql-setup is the wave of the future.  I don't imagine that we'll keep the stub service file around forever, or for that matter that systemd is going to keep the "service" command around forever.  I see this as just a stopgap measure to provide some temporary backward compatibility until people get used to the new way.  (In view of comment #8, I may get forced to drop the stub script anyway, so I'm certainly not going to make it the only way to do things.)

Comment 14 Karel Volný 2012-03-15 18:03:38 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #7)
> > > I'm still going to only document the usage of postgresql-setup, but for
> > > anybody with "service postgresql initdb" wired into their fingertips, it'll
> > > continue to work like it did before.
> > 
> > thinking about it ... is it too late to throw away this postgresql-setup if the
> > old way works?
> 
> postgresql-setup is the wave of the future.  I don't imagine that we'll keep
> the stub service file around forever, or for that matter that systemd is going
> to keep the "service" command around forever.  I see this as just a stopgap
> measure to provide some temporary backward compatibility until people get used
> to the new way.  (In view of comment #8, I may get forced to drop the stub
> script anyway, so I'm certainly not going to make it the only way to do
> things.)

well, seems I completely misunderstood the point of comment #7, sorry

so, in the bright future, instead of telling to a service what you want to do with it (possibly asking it which actions does it support), one will have to start (and then what, stop?) a separate service per each action, trying to guess the right name from a list of all available^W known units?

could we at least keep the unit names consistent with the original actions, i.e. postgresql-initdb instead of postgresql-setup, or is there a reason to break every single bit of similarity to previous version?

and btw, as some kind of setup needed before the first run is quite a common thing, wouldn't that be possible to add such command to those chosen to be supported, instead of having zillions of new units created to be run once and then just take up space in the listings? (in that case I wouldn't insist on calling the command "initdb" :-))

Comment 15 Tom Lane 2012-03-15 18:19:34 UTC
(In reply to comment #14)
> so, in the bright future, instead of telling to a service what you want to do
> with it (possibly asking it which actions does it support), one will have to
> start (and then what, stop?) a separate service per each action, trying to
> guess the right name from a list of all available^W known units?

Well, you're complaining to the wrong person.  It was not my decision that systemd should not offer any equivalent to the nonstandard actions that were possible in SysV scripts.  If you want to file a bug about that, systemd is the component to complain to.  (But I think they've heard it before.)

> could we at least keep the unit names consistent with the original actions,
> i.e. postgresql-initdb instead of postgresql-setup, or is there a reason to
> break every single bit of similarity to previous version?

You're about six months too late to be quibbling with the naming choices; that script shipped in F-16 and I'm not going to revisit its API now.  In any case, yes there is a reason not to call it postgresql-initdb: initdb is not the only action it has.

Comment 16 Karel Volný 2012-03-20 11:54:28 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > so, in the bright future, instead of telling to a service what you want to do
> > with it (possibly asking it which actions does it support), one will have to
> > start (and then what, stop?) a separate service per each action, trying to
> > guess the right name from a list of all available^W known units?
> 
> Well, you're complaining to the wrong person.  It was not my decision that
> systemd should not offer any equivalent to the nonstandard actions that were
> possible in SysV scripts.  If you want to file a bug about that, systemd is the
> component to complain to.  (But I think they've heard it before.)

I don't think that such report from an user POV would draw any attention - we will just add another "case version in ..." workaround into our tests; it is our job, if the company wants us to waste our time on updating for new versions incompatibilities then we'll do what we are paid for

if the design wasn't such big obstacle for you, from the developer POV, to try to change it ... then just let the _customers_ to complain

...
> You're about six months too late to be quibbling with the naming choices; that
> script shipped in F-16 and I'm not going to revisit its API now.

if only we had the opportunity to run our testsuite in Beaker on that code those six months ago ...

hm, this sounds familiar ... http://home.comcast.net/~tomhorsley/game/rules-change.html

> In any case, yes there is a reason not to call it postgresql-initdb: initdb is
> not the only action it has.

ok, makes sense

Comment 17 Tom Lane 2012-06-03 02:56:27 UTC
I tried to deal with this complaint by adding a stub initscript in postgresql-9.1.3-2, but in view of the fedora-packaging thread starting at
http://lists.fedoraproject.org/pipermail/packaging/2012-April/008314.html
I am going to have to take it out again.  Sorry.

Comment 18 Karel Volný 2012-06-05 11:36:07 UTC
(In reply to comment #17)
> I tried to deal with this complaint by adding a stub initscript in
> postgresql-9.1.3-2, but in view of the fedora-packaging thread starting at
> http://lists.fedoraproject.org/pipermail/packaging/2012-April/008314.html
> I am going to have to take it out again.  Sorry.

thanks for your efforts

just a note to that thread ... it is not a matter of "users not reading the release notes", rather there is a problem that you have to do a "change for a change", spend a lot of man-hours rewriting the code which was supposed to work "forever" - simply reading the release notes won't fix all the broken things, as demonstrated by this bug, there are zillions of scripts relying on the fact that "service name action" will do the job which is no longer true (for some of the actions)

the "service" command was supposed to act as a wrapper, no matter if the backend init system is SysV, OpenRC, Upstart or whatever ... and it has worked ... until systemd

consider railways - we had horses, steam engines, we have diesel and electric engines now, but still they use the standard Stephenson gauge, you can pull out the steam locomotive out of the museum and do a historic ride ... now someone comes and says "from now on, Scotch gauge is the one and only that fits them all, you can only buy locomotives and cars in 54 inch variant, now go rebuild all your obsolete tracks and scrap all those old vehicles at your expense!" - sounds absurd? - yet the same principle is praised in case of systemd

Comment 19 Tom Lane 2012-07-15 04:13:08 UTC
Well, per the discussion at
http://lists.fedoraproject.org/pipermail/devel/2012-June/169411.html
there is now an approved way to support "legacy" initscript actions after all, so I've pushed support for that into rawhide.


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