Your message dated Thu, 11 Oct 2018 15:20:13 +0200
with message-id <[email protected]>
and subject line Re: Bug#890427: postgresql-common: configured 
stats_temp_directory does not get created after reboot
has caused the Debian Bug report #890427,
regarding postgresql-common: configured stats_temp_directory does not get 
created after reboot
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
890427: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890427
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: postgresql-common
Version: 190
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu bionic ubuntu-patch

Dear Maintainer,

default postgres installation in Debian (and Ubuntu) configures 
stats_temp_directory inside /var/run/postgresql:

$ grep stats_temp /etc/postgresql/10/main/postgresql.conf
stats_temp_directory = '/var/run/postgresql/10-main.pg_stat_tmp'

However, this directory is not created after reboot.

In most cases this is not a problem as systemd starts postgres via
pg_ctlcluster, a "multiversion/cluster aware pg_ctl wrapper", and
pg_ctlcluster will create missing directories before starting postgres.

But in cases where systemd is not starting postgres this is a problem.
Specifically, when postgres is controlled by pacemaker (using postgres
resource agent for pacemaker) it is started using pg_ctl wrapper. pg_ctl
won't create missing directories and therefore postgres fails to start.

The simplest solution for this issue is to have systemd recreate missing
directories via /usr/lib/tmpfiles.d/postgresql.conf file.

Currently only /var/run/postgresql and /var/log/postgresql are created using
systemd-tmpfiles.


In Ubuntu, the attached patch was applied to achieve the following:

  * d/postgresql-common.postgresql.tmpfile: add stats_temp_directory to
    tempfiles created. (Closes: #1749283) 


Thanks for considering the patch.


-- System Information:
Debian Release: stretch/sid
  APT prefers artful-updates
  APT policy: (500, 'artful-updates'), (500, 'artful-security'), (500, 
'artful'), (100, 'artful-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-32-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru postgresql-common-190/debian/postgresql-common.postgresql.tmpfile 
postgresql-common-190ubuntu1/debian/postgresql-common.postgresql.tmpfile
--- postgresql-common-190/debian/postgresql-common.postgresql.tmpfile   
2018-01-12 15:08:46.000000000 +0100
+++ postgresql-common-190ubuntu1/debian/postgresql-common.postgresql.tmpfile    
2018-02-14 13:10:08.000000000 +0100
@@ -1,4 +1,5 @@
 # Directory for PostgreSQL sockets, lockfiles and stats tempfiles
 d /var/run/postgresql 2775 postgres postgres - -
+d /var/run/postgresql/10-main.pg_stat_tmp 2770 postgres postgres  - - 
 # Log directory
 d /var/log/postgresql 1775 root postgres - -

--- End Message ---
--- Begin Message ---
Control: tags -1 wontfix

Re: Mario Splivalo 2018-02-14 
<151862680032.4548.10774284017883634650.reportbug@mx260>
> In Ubuntu, the attached patch was applied to achieve the following:
> 
>   * d/postgresql-common.postgresql.tmpfile: add stats_temp_directory to
>     tempfiles created. (Closes: #1749283) 
> 
> +++ postgresql-common-190ubuntu1/debian/postgresql-common.postgresql.tmpfile  
> 2018-02-14 13:10:08.000000000 +0100
> @@ -1,4 +1,5 @@
>  # Directory for PostgreSQL sockets, lockfiles and stats tempfiles
>  d /var/run/postgresql 2775 postgres postgres - -
> +d /var/run/postgresql/10-main.pg_stat_tmp 2770 postgres postgres  - - 

Hi Mario,

that patch is incomplete because it applies to 10-main only.

The proper solution here is either
* teach the pacemaker agent to create the directory
* put the directory elsewhere
* not use pg_createcluster in the first place as you aren't going to
  use pg_ctlcluster
* maybe use a systemd generator to create the files, but that will
  probably not work because pacemaker wouldn't necessarily exercise
  it

I don't think there is anything to fix in postgresql-common because
the problem is only because postgresql-common is *not* used.

Which pacemaker agent are you (Ubuntu) using?

I recommend dropping this patch from Ubuntu's postgresql-common.

Christoph

--- End Message ---

Reply via email to