Re: Service not starting on Ubuntu 15.04 - Mailing list pgsql-general

From Lasse Westh-Nielsen
Subject Re: Service not starting on Ubuntu 15.04
Date
Msg-id CAFyxdeSZh=Fv6nikh1_WqAtyKc0nmKTdTvj8-+JzYw-GobZnzw@mail.gmail.com
Whole thread Raw
In response to Re: Service not starting on Ubuntu 15.04  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
Nope, the log is empty. Literally zero bytes.

On Mon, Oct 26, 2015 at 3:57 PM, Melvin Davidson <melvin6925@gmail.com> wrote:
Just out of curiosity, is there anything in the postgresql.log which gives an indication of a problem?

On Mon, Oct 26, 2015 at 11:18 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 10/26/2015 08:04 AM, Lasse Westh-Nielsen wrote:
Adrian,

The service starts once the package is installed.

  - It did that on Ubuntu14.04
  - On Ubuntu 15.04, `sudo service postgresql status` _claims_ it has
been started.

Yes, it starts but it is a go nowhere, do nothing service:

    $ cat /etc/systemd/system/multi-user.target.wants/postgresql.service
    # systemd service for managing all PostgreSQL clusters on the system. This
    # service is actually a systemd target, but we are using a service since
    # targets cannot be reloaded.

    [Unit]
    Description=PostgreSQL RDBMS

    [Service]
    Type=oneshot
    ExecStart=/bin/true
    ExecReload=/bin/true
    RemainAfterExit=on

    [Install]
    WantedBy=multi-user.target

All it does is start /bin/true which is why the status shows it started, but Postgres does not run. My guess is the answer is in here:

http://askubuntu.com/questions/632882/does-upstart-really-handle-all-startup-scripts

Second answer

" PostgreSQL comes with two systemd service unit files in version 15, /lib/systemd/system/postgresql@.service and /lib/systemd/system/postgresql.service. System 5 rc stuff is thus completely ignored."


Best guess is /lib/systemd/system/postgresql@.service is the one that actually starts Postgres. Sort of confirmed by the comments in the service script above:

"# systemd service for managing all PostgreSQL clusters on the system. This
# service is actually a systemd target, but we are using a service since
# targets cannot be reloaded."

Pretty sure /lib/systemd/system/postgresql.service is just a placeholder script.

At any rate Stuarts answer and your application of it confirms the service script is the issue.




On Mon, Oct 26, 2015 at 2:57 PM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

    On 10/26/2015 07:08 AM, Lasse Westh-Nielsen wrote:

        Adrian,

        Thanks. I know about the systemd change, and indeed the postgres
        package
        I end up with _has_ systemd integration already:

             $ cat
        /etc/systemd/system/multi-user.target.wants/postgresql.service
             # systemd service for managing all PostgreSQL clusters on the
             system. This
             # service is actually a systemd target, but we are using a
        service since
             # targets cannot be reloaded.

             [Unit]
             Description=PostgreSQL RDBMS

             [Service]
             Type=oneshot
             ExecStart=/bin/true
             ExecReload=/bin/true
             RemainAfterExit=on

             [Install]
             WantedBy=multi-user.target


    The thing above the above is I do not see anything that starts Postgres.

    Are you sure the same script is being called in cloud-init and
    outside of it?

    Or more to the point, what script actually starts Postgres?




    --
    Adrian Klaver
    adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>




--
Adrian Klaver
adrian.klaver@aklaver.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.


pgsql-general by date:

Previous
From: Harald Fuchs
Date:
Subject: Re: Recursive Arrays 101
Next
From: Adrian Klaver
Date:
Subject: Re: Recursive Arrays 101