Re: BUG #16565: Systemd service file does not create /var/run/postgresql directory across reboot

From: Marco Cuccato <mcuccato(dot)vts(at)gmail(dot)com>
To: mcuccato(dot)vts(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16565: Systemd service file does not create /var/run/postgresql directory across reboot
Date: 2020-07-31 13:03:03
Message-ID: CACg0f4bsLHQpQQ=w0uGBoJOeZ4+Oh779hboGMOud9nkxtzytAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Fixed by myself creating a /etc/systemd/system/postgresql-12.service with
this content:

.include /usr/lib/systemd/system/postgresql-12.service
[Service]
RuntimeDirectory=postgresql

The RuntimeDirectory directive should be included in original
/usr/lib/systemd/system/postgresql-12.service file.

Il giorno ven 31 lug 2020 alle ore 15:01 PG Bug reporting form <
noreply(at)postgresql(dot)org> ha scritto:

> The following bug has been logged on the website:
>
> Bug reference: 16565
> Logged by: Marco Cuccato
> Email address: mcuccato(dot)vts(at)gmail(dot)com
> PostgreSQL version: 12.3
> Operating system: Red Hat Enterprise Linux Server release 7.6
> Description:
>
> When the server is rebooted, PostgreSQL service doesn't start because of
> this error:
> FATAL: could not create lock file
> "/var/run/postgresql/.s.PGSQL.5432.lock":
> No such file or directory
>
> This happens because it tries to create the lock file under
> /var/run/postgresql that doesn't exists. It doesn't exist because /var/run
> is a symlink to ../run (/run as absolute path) that is mounted as tmpfs.
> As tmpfs is not persistent, when the server is rebooted the directory
> doesn't exists and must be re-created.
> Doing that, the lock file will be created successfully and the service will
> start up correctly.
>
> Please fix the postgresql-12.service systemd file: make it check and
> eventually create /var/run/postgresql directory.
> Thanks
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-07-31 19:09:48 BUG #16566: Consistently link latest repo RPM release to pgdg-redhat-repo-latest (ref #16074)
Previous Message PG Bug reporting form 2020-07-31 10:05:14 BUG #16565: Systemd service file does not create /var/run/postgresql directory across reboot