Wrong PID name for PostgreSQL in Ubuntu image

Bug #1744098 reported by Gaëtan Trellu
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
In Progress
Gaëtan Trellu

Bug Description

The PostgreSQL 9.4 build on Ubuntu Xenial doesn't work correctly with the way how the Trove guest agent is configured.

Trove guest agent is looking for a PID named "postgresql.pid" but the one configured by default in PostgreSQL is "9.4-main.pid".

Changing only the systemd unit file is not enough, the "postgresql.conf" as to be changed too.

Tags: trove
Changed in trove:
assignee: nobody → Gaëtan Trellu (goldyfruit)
tags: added: trove
Revision history for this message
Gaëtan Trellu (goldyfruit) wrote :
Changed in trove:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on trove (master)

Change abandoned by Ga?tan Trellu (<email address hidden>) on branch: master
Review: https://review.openstack.org/535369
Reason: Already fixed there: https://review.openstack.org/#/c/534667/

Revision history for this message
Pierre Blanc (pierreblanc75) wrote :

This bug is resolve by this commit: https://review.openstack.org/#/c/534667/

You can close this bug.

Revision history for this message
Mark Kirkwood (mark-kirkwood) wrote :

I'm seeing exactly this issue on a devstack setup (master from last week) that makes a xenial guest. I note that the systemd unit file: /lib/systemd/system/postgresql@.service has:

PIDFile=/run/postgresql/%i.pid # note %i = 9.6/main

So 'service postgresql start' and all variants thereof end up hanging forever awaiting the wrong pidfile, and the guest ends up in a state where the service thinks postgres is down but it is actually up.

I think this is happening because the service discovery code in Trove checks for upstart, sysv and systemd in that order. So on xenial it finds a postgresql file in /etc/init.d and decides we are sysv - so does not apply trove/integration/scripts/files/elements/ubuntu-xenial-postgresql/install.d/31-fix-init-script to amend the pifile in the systemd unit. I'm thinking that the detection should be in upstart, systemd then sysv order.

Revision history for this message
Mark Kirkwood (mark-kirkwood) wrote :

FWIW - manipualating the devstack generated image to fix the systemd unit file, then re-uploading it, results in a guest in ACTIVE state after launching a new instance. So we need to figure out how to apply those existing fixes during the guest image build.

Revision history for this message
Mark Kirkwood (mark-kirkwood) wrote :

FWIW, there is a ubuntu-xenial-postgresql/install.d/31-fix-init-script that changes the pidfile...however it is either not being run or overwritten later, as the built image (as indicated above) has the wrong pidfile.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers