public inbox for [email protected]
help / color / mirror / Atom feedFrom: Guillaume Lelarge <[email protected]>
To: pgsql-pkg-yum <[email protected]>
Subject: Re: Bug in repmgr3 package
Date: Tue, 3 Nov 2015 15:42:25 +0100
Message-ID: <CAECtzeU3j1HxgV730E5h+Sfe0AKTom9C+0Buoycg2ZUebipeXQ@mail.gmail.com> (raw)
In-Reply-To: <CAECtzeUGuSHi_QHbswo579p20z87zwYjZUHBQbppCUOKJ70FXw@mail.gmail.com>
References: <CAECtzeUGuSHi_QHbswo579p20z87zwYjZUHBQbppCUOKJ70FXw@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-pkg-yum>
Hey,
2015-11-03 10:54 GMT+01:00 Guillaume Lelarge <[email protected]>:
> Hi,
>
> When installing repmgr3 package on a CentOS 6 64 bits, I always end up
> with an error at postinstall saying that /var/run/repmgr doesn't exist.
>
> Here is a patch that will hopefully fix that. (The patch deals with all
> distro for 9.4 release. I didn't check other releases.)
>
>
I worked a bit more with repmgr. I found that the initscript doesn't
respect the $user variable all the time. Hence this new patch (which
includes the changes from the first patch).
I'm also wondering why we do have this new OS user (repmgr). It seems to be
more a burden than anything else. Actually, they have a much better
initscript in upstream that makes use the postgres OS user. The RPM package
should embrace that change.
Regards.
--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com
--
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum
Attachments:
[text/x-patch] repmgr-v2.patch (8.0K, 3-repmgr-v2.patch)
download | inline diff:
diff --git a/rpm/redhat/9.4/repmgr/EL-5/repmgr.init b/rpm/redhat/9.4/repmgr/EL-5/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/EL-5/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/EL-5/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/EL-5/repmgr.spec b/rpm/redhat/9.4/repmgr/EL-5/repmgr.spec
index aba8b39..29c629a 100644
--- a/rpm/redhat/9.4/repmgr/EL-5/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/EL-5/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -R repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
diff --git a/rpm/redhat/9.4/repmgr/EL-6/repmgr.init b/rpm/redhat/9.4/repmgr/EL-6/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/EL-6/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/EL-6/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/EL-6/repmgr.spec b/rpm/redhat/9.4/repmgr/EL-6/repmgr.spec
index aba8b39..29c629a 100644
--- a/rpm/redhat/9.4/repmgr/EL-6/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/EL-6/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -R repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
diff --git a/rpm/redhat/9.4/repmgr/EL-7/repmgr.init b/rpm/redhat/9.4/repmgr/EL-7/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/EL-7/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/EL-7/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/EL-7/repmgr.spec b/rpm/redhat/9.4/repmgr/EL-7/repmgr.spec
index aba8b39..29c629a 100644
--- a/rpm/redhat/9.4/repmgr/EL-7/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/EL-7/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -R repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
diff --git a/rpm/redhat/9.4/repmgr/F-20/repmgr.init b/rpm/redhat/9.4/repmgr/F-20/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/F-20/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/F-20/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/F-20/repmgr.spec b/rpm/redhat/9.4/repmgr/F-20/repmgr.spec
index aba8b39..29c629a 100644
--- a/rpm/redhat/9.4/repmgr/F-20/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/F-20/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -R repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
diff --git a/rpm/redhat/9.4/repmgr/F-21/repmgr.init b/rpm/redhat/9.4/repmgr/F-21/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/F-21/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/F-21/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/F-21/repmgr.spec b/rpm/redhat/9.4/repmgr/F-21/repmgr.spec
index aba8b39..29c629a 100644
--- a/rpm/redhat/9.4/repmgr/F-21/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/F-21/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -R repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
diff --git a/rpm/redhat/9.4/repmgr/F-22/repmgr.init b/rpm/redhat/9.4/repmgr/F-22/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/F-22/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/F-22/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/F-22/repmgr.spec b/rpm/redhat/9.4/repmgr/F-22/repmgr.spec
index aba8b39..5ae706f 100644
--- a/rpm/redhat/9.4/repmgr/F-22/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/F-22/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -r repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
diff --git a/rpm/redhat/9.4/repmgr/F-23/repmgr.init b/rpm/redhat/9.4/repmgr/F-23/repmgr.init
index c900170..95e3757 100644
--- a/rpm/redhat/9.4/repmgr/F-23/repmgr.init
+++ b/rpm/redhat/9.4/repmgr/F-23/repmgr.init
@@ -54,7 +54,7 @@ start(){
mkdir -p $(dirname $pidfile)
chown $user: $(dirname $pidfile)
- su -l repmgr -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
+ su -l $user -c "$exec -f $REPMGRDCONF -p $pidfile -d ->> $REPMGRDLOG 2>&1" $user # --monitoring-history --verbose
retval=$?
[ $retval -eq 0 ] && success
echo
diff --git a/rpm/redhat/9.4/repmgr/F-23/repmgr.spec b/rpm/redhat/9.4/repmgr/F-23/repmgr.spec
index aba8b39..5ae706f 100644
--- a/rpm/redhat/9.4/repmgr/F-23/repmgr.spec
+++ b/rpm/redhat/9.4/repmgr/F-23/repmgr.spec
@@ -115,7 +115,11 @@ fi
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{sname}-%{pgpackageversion}
%endif
-%{__chown} repmgr: %{_localstatedir}/run/%{sname}
+if [ ! -x %{_varrundir} ]
+then
+ %{__mkdir} -m 700 %{_varrundir}
+ %{__chown} -r repmgr: %{_varrundir}
+fi
%postun -p /sbin/ldconfig
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Bug in repmgr3 package
In-Reply-To: <CAECtzeU3j1HxgV730E5h+Sfe0AKTom9C+0Buoycg2ZUebipeXQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox