Merge ~paelzer/ubuntu/+source/resource-agents:xenial-1749283-postgresdir into ubuntu/+source/resource-agents:ubuntu/xenial-devel

Proposed by Christian Ehrhardt 
Status: Rejected
Rejected by: Christian Ehrhardt 
Proposed branch: ~paelzer/ubuntu/+source/resource-agents:xenial-1749283-postgresdir
Merge into: ubuntu/+source/resource-agents:ubuntu/xenial-devel
Diff against target: 106 lines (+84/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/lp-1749283-pgsql-stats_temp_directory.patch (+76/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Canonical Server Pending
Canonical Server packageset reviewers Pending
Review via email: mp+365029@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The SRU template isn't ready yet as I wait for some feedback.
But the suggested fix can be reviewed already here.

A PPA with a build is available at https://launchpad.net/~paelzer/+archive/ubuntu/bug-1749283-resource-agent-to-start-pgsql/+packages

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Fix looks good, but I wonder if we shouldn't also fix it in postgresql-common via systemd tempfiles as was also suggested. Not for an SRU perhaps, but in disco?

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

self-rejecting as Mmike said he will fix it.

Unmerged commits

b62d92c... by Christian Ehrhardt 

changelog: fix start of postgresql to provide the expected stats_temp_directory (LP: #1749283)

Signed-off-by: Christian Ehrhardt <email address hidden>

31bdbbe... by Christian Ehrhardt 

d/p/lp-1749283-pgsql-stats_temp_directory.patch: fix start of
postgresql to provide the expected stats_temp_directory (LP: #1749283)

Signed-off-by: Christian Ehrhardt <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 3932f71..ede8599 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+resource-agents (1:3.9.7-1ubuntu0.1) xenial; urgency=medium
7+
8+ * d/p/lp-1749283-pgsql-stats_temp_directory.patch: fix start of
9+ postgresql to provide the expected stats_temp_directory (LP: #1749283)
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 25 Mar 2019 12:36:09 +0100
12+
13 resource-agents (1:3.9.7-1) unstable; urgency=medium
14
15 * New upstream release.
16diff --git a/debian/patches/lp-1749283-pgsql-stats_temp_directory.patch b/debian/patches/lp-1749283-pgsql-stats_temp_directory.patch
17new file mode 100644
18index 0000000..8b8e7ae
19--- /dev/null
20+++ b/debian/patches/lp-1749283-pgsql-stats_temp_directory.patch
21@@ -0,0 +1,76 @@
22+From 00d888c00651eb178dc3a97d50359571963b5d44 Mon Sep 17 00:00:00 2001
23+From: Valentin Vidic <Valentin.Vidic@CARNet.hr>
24+Date: Fri, 9 Feb 2018 12:30:29 +0100
25+Subject: [PATCH] pgsql: try to create stats_temp_directory
26+
27+Database fails to start correctly if the stats_temp_directory
28+is specified in the configuration but does not exists.
29+
30+Origin: upstream, https://github.com/ClusterLabs/resource-agents/pull/1102/commits/00d888c00651eb178dc3a97d50359571963b5d44
31+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1749283
32+Last-Update: 2019-03-25
33+
34+---
35+ heartbeat/pgsql | 39 +++++++++++++++++++++++++++++++++++++++
36+ 1 file changed, 39 insertions(+)
37+
38+diff --git a/heartbeat/pgsql b/heartbeat/pgsql
39+index 3ded3ca2e..3e0158adb 100755
40+--- a/heartbeat/pgsql
41++++ b/heartbeat/pgsql
42+@@ -575,6 +575,8 @@ pgsql_real_start() {
43+ check_socket_dir
44+ fi
45+
46++ check_stat_temp_directory
47++
48+ if [ "$OCF_RESKEY_rep_mode" = "slave" ]; then
49+ rm -f $RECOVERY_CONF
50+ make_recovery_conf || return $OCF_ERR_GENERIC
51+@@ -1977,6 +1979,43 @@ check_log_file() {
52+ return 0
53+ }
54+
55++#
56++# Check if we need to create stats temp directory in tmpfs
57++#
58++
59++check_stat_temp_directory() {
60++ local stats_temp
61++
62++ stats_temp=`get_pgsql_param stats_temp_directory`
63++
64++ if [ -z "$stats_temp" ]; then
65++ return
66++ fi
67++
68++ if [ "${stats_temp#/}" = "$stats_temp" ]; then
69++ stats_temp="$OCF_RESKEY_pgdata/$stats_temp"
70++ fi
71++
72++ if [ -d "$stats_temp" ]; then
73++ return
74++ fi
75++
76++ if ! mkdir -p "$stats_temp"; then
77++ ocf_exit_reason "Can't create directory $stats_temp"
78++ exit $OCF_ERR_PERM
79++ fi
80++
81++ if ! chown $OCF_RESKEY_pgdba: "$stats_temp"; then
82++ ocf_exit_reason "Can't change ownership for $stats_temp"
83++ exit $OCF_ERR_PERM
84++ fi
85++
86++ if ! chmod 750 "$stats_temp"; then
87++ ocf_exit_reason "Can't change permissions for $stats_temp"
88++ exit $OCF_ERR_PERM
89++ fi
90++}
91++
92+ #
93+ # Check socket directory
94+ #
95+--
96+2.17.1
97+
98diff --git a/debian/patches/series b/debian/patches/series
99index a467edb..8d8e742 100644
100--- a/debian/patches/series
101+++ b/debian/patches/series
102@@ -3,3 +3,4 @@
103 mysql-path.patch
104 no-dirty-version
105 runocft
106+lp-1749283-pgsql-stats_temp_directory.patch

Subscribers

People subscribed via source and target branches