From 037317062fd60a762f8f44820a914bbb2ca66dfb Mon Sep 17 00:00:00 2001 From: "Tom \"spot\" Callaway" Date: Wed, 14 Sep 2011 12:25:57 -0400 Subject: [PATCH 1/5] convert to systemd --- pgpool-3.1-conf.sample.patch | 40 ++++++++++++++++ pgpool.service | 10 ++++ postgresql-pgpool-II.spec | 93 +++++++++++++++++++++++------------- sources | 2 +- 4 files changed, 112 insertions(+), 33 deletions(-) create mode 100644 pgpool-3.1-conf.sample.patch create mode 100644 pgpool.service diff --git a/pgpool-3.1-conf.sample.patch b/pgpool-3.1-conf.sample.patch new file mode 100644 index 0000000..990614a --- /dev/null +++ b/pgpool-3.1-conf.sample.patch @@ -0,0 +1,40 @@ +diff -up pgpool-II-3.1/pgpool.conf.sample.orig pgpool-II-3.1/pgpool.conf.sample +--- pgpool-II-3.1/pgpool.conf.sample.orig 2011-08-25 17:04:43.000000000 -0400 ++++ pgpool-II-3.1/pgpool.conf.sample 2011-09-12 10:51:53.136935503 -0400 +@@ -33,8 +33,6 @@ port = 9999 + # (change requires restart) + socket_dir = '/tmp' + # Unix domain socket path +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + +@@ -45,12 +43,16 @@ pcp_port = 9898 + # (change requires restart) + pcp_socket_dir = '/tmp' + # Unix domain socket path for pcp +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + # - Backend Connection Settings - + ++backend_hostname0 = 'localhost' ++backend_port0 = 5432 ++backend_weight0 = 1 ++backend_data_directory0 = '/var/lib/pgsql/data' ++backend_flag0 = 'ALLOW_TO_FAILOVER' ++ + #backend_hostname0 = 'host1' + # Host name or IP address to connect to for backend 0 + #backend_port0 = 5432 +@@ -179,7 +181,7 @@ debug_level = 0 + pid_file_name = '/var/run/pgpool/pgpool.pid' + # PID file name + # (change requires restart) +-logdir = '/tmp' ++logdir = '/var/log/pgpool' + # Directory of pgPool status file + # (change requires restart) + diff --git a/pgpool.service b/pgpool.service new file mode 100644 index 0000000..01bb6c4 --- /dev/null +++ b/pgpool.service @@ -0,0 +1,10 @@ +[Unit] +Description=PGPool-II Middleware Between PostgreSQL Servers And PostgreSQL Database Clients +After=syslog.target network.target + +[Service] +EnvironmentFile=-/etc/sysconfig/pgpool +ExecStart=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $OPTS + +[Install] +WantedBy=multi-user.target diff --git a/postgresql-pgpool-II.spec b/postgresql-pgpool-II.spec index d847d3a..c79ce99 100644 --- a/postgresql-pgpool-II.spec +++ b/postgresql-pgpool-II.spec @@ -1,20 +1,23 @@ %define short_name pgpool-II -Summary: Pgpool is a connection pooling/replication server for PostgreSQL -Name: postgresql-%{short_name} -Version: 2.3.1 -Release: 2%{?dist} -License: BSD -Group: Applications/Databases -URL: http://pgpool.projects.PostgreSQL.org -Source0: http://pgfoundry.org/frs/download.php/2506/%{short_name}-%{version}.tar.gz -Source1: pgpool.init -Source2: pgpool.sysconfig -Patch1: pgpool.conf.sample.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: postgresql-devel pam-devel - -Obsoletes: postgresql-pgpool +Summary: Pgpool is a connection pooling/replication server for PostgreSQL +Name: postgresql-%{short_name} +Version: 3.1 +Release: 1%{?dist} +License: BSD +Group: Applications/Databases +URL: http://pgpool.projects.PostgreSQL.org +Source0: http://pgfoundry.org/frs/download.php/3114/%{short_name}-%{version}.tar.gz +Source1: pgpool.service +Source2: pgpool.sysconfig +Patch1: pgpool-3.1-conf.sample.patch +BuildRequires: postgresql-devel pam-devel +BuildRequires: systemd-units +Requires(post): systemd-sysv +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +Obsoletes: postgresql-pgpool %description pgpool-II is a inherited project of pgpool (to classify from @@ -44,7 +47,7 @@ Development headers and libraries for pgpool-II. %prep %setup -q -n %{short_name}-%{version} -%patch1 -p0 +%patch1 -p1 -b .samplefix %build %configure --with-pgsql-includedir=%{_includedir}/pgsql --with-pgsql-lib=%{_libdir}/pgsql --disable-static --with-pam --disable-rpath --sysconfdir=%{_sysconfdir}/%{short_name}/ @@ -52,7 +55,6 @@ Development headers and libraries for pgpool-II. make %{?_smp_flags} %install -rm -rf %{buildroot} make %{?_smp_flags} DESTDIR=%{buildroot} install install -d %{buildroot}%{_datadir}/%{short_name} install -d %{buildroot}%{_sysconfdir}/%{short_name} @@ -61,62 +63,89 @@ mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample %{buildroot}%{_s mv %{buildroot}/%{_sysconfdir}/%{short_name}/pool_hba.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pool_hba.conf mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-master-slave %{buildroot}%{_datadir}/%{short_name}/ mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-replication %{buildroot}%{_datadir}/%{short_name}/ +mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-stream %{buildroot}%{_datadir}/%{short_name}/ -install -d %{buildroot}%{_initrddir} -install -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/pgpool +install -d %{buildroot}%{_unitdir} +install -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/pgpool.service install -d %{buildroot}%{_sysconfdir}/sysconfig install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool # nuke libtool archive and static lib rm -f %{buildroot}%{_libdir}/libpcp.{a,la} -%clean -rm -rf %{buildroot} - %post /sbin/ldconfig -chkconfig --add pgpool - -%preun -if [ $1 = 0 ] ; then - /sbin/service pgpool condstop >/dev/null 2>&1 - chkconfig --del pgpool +if [ $1 -eq 1 ] ; then + # Initial installation + /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi -%postun -p /sbin/ldconfig +%preun +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable pgpool.service > /dev/null 2>&1 || : + /bin/systemctl stop pgpool.service > /dev/null 2>&1 || : +fi + +%postun +/sbin/ldconfig +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || : +fi + +%triggerun -- pgpool < 3.1-1 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply pgpool +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save pgpool >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del pgpool >/dev/null 2>&1 || : +/bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || : %files -%defattr(-,root,root,-) %doc README README.euc_jp TODO COPYING INSTALL AUTHORS ChangeLog NEWS doc/pgpool-en.html doc/pgpool-ja.html doc/pgpool.css doc/tutorial-en.html doc/tutorial-ja.html %{_bindir}/pgpool %{_bindir}/pcp_attach_node %{_bindir}/pcp_detach_node %{_bindir}/pcp_node_count %{_bindir}/pcp_node_info +%{_bindir}/pcp_pool_status %{_bindir}/pcp_proc_count %{_bindir}/pcp_proc_info +%{_bindir}/pcp_promote_node %{_bindir}/pcp_recovery_node %{_bindir}/pcp_stop_pgpool %{_bindir}/pcp_systemdb_info %{_bindir}/pg_md5 %{_mandir}/man8/pgpool* %dir %{_datadir}/%{short_name} +%{_datadir}/%{short_name}/insert_lock.sql %{_datadir}/%{short_name}/system_db.sql %{_datadir}/%{short_name}/pgpool.conf.sample-master-slave %{_datadir}/%{short_name}/pgpool.conf.sample-replication +%{_datadir}/%{short_name}/pgpool.conf.sample-stream %{_libdir}/libpcp.so.* %{_datadir}/%{short_name}/pgpool.pam -%{_initrddir}/pgpool +%{_unitdir}/pgpool.service %attr(764,root,root) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf %config(noreplace) %{_sysconfdir}/sysconfig/pgpool %files devel -%defattr(-,root,root,-) +%{_includedir}/libpcp_ext.h %{_includedir}/pcp.h +%{_includedir}/pool_process_reporting.h %{_includedir}/pool_type.h %{_libdir}/libpcp.so + %changelog +* Mon Sep 12 2011 Tom Callaway - 3.1-1 +- update to 3.1 +- convert to systemd + * Wed Feb 09 2011 Fedora Release Engineering - 2.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild diff --git a/sources b/sources index 59dbedc..13f1e56 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -032fc94eaa71ed99276234b7a110cdf5 pgpool-II-2.3.1.tar.gz +dbb591a8aa3c3bd1e689f41a7638b9ee pgpool-II-3.1.tar.gz From 133307e7991c18c21b9fd584ab576d7b5522adb9 Mon Sep 17 00:00:00 2001 From: Devrim GUNDUZ Date: Tue, 27 Mar 2012 01:53:31 +0300 Subject: [PATCH 2/5] Update to 3.1.2 --- .gitignore | 2 +- postgresql-pgpool-II.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9ae6c1e..2a03744 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -pgpool-II-2.3.1.tar.gz +/pgpool-II-3.1.2.tar.gz diff --git a/postgresql-pgpool-II.spec b/postgresql-pgpool-II.spec index c79ce99..4d4c1f3 100644 --- a/postgresql-pgpool-II.spec +++ b/postgresql-pgpool-II.spec @@ -2,7 +2,7 @@ Summary: Pgpool is a connection pooling/replication server for PostgreSQL Name: postgresql-%{short_name} -Version: 3.1 +Version: 3.1.2 Release: 1%{?dist} License: BSD Group: Applications/Databases @@ -142,6 +142,9 @@ fi %changelog +* Tue Mar 27 2012 Devrim Gunduz - 3.1.2-1 +- update to 3.1.2 + * Mon Sep 12 2011 Tom Callaway - 3.1-1 - update to 3.1 - convert to systemd diff --git a/sources b/sources index 13f1e56..1e9a537 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dbb591a8aa3c3bd1e689f41a7638b9ee pgpool-II-3.1.tar.gz +4c0bbf0544c8b6f219501730d711e519 pgpool-II-3.1.2.tar.gz From dc95f897e5410a24527353de30dd46f05b8de034 Mon Sep 17 00:00:00 2001 From: Devrim GUNDUZ Date: Tue, 27 Mar 2012 02:22:17 +0300 Subject: [PATCH 3/5] Update project URL --- postgresql-pgpool-II.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgresql-pgpool-II.spec b/postgresql-pgpool-II.spec index 4d4c1f3..bfbd0ee 100644 --- a/postgresql-pgpool-II.spec +++ b/postgresql-pgpool-II.spec @@ -6,8 +6,8 @@ Version: 3.1.2 Release: 1%{?dist} License: BSD Group: Applications/Databases -URL: http://pgpool.projects.PostgreSQL.org -Source0: http://pgfoundry.org/frs/download.php/3114/%{short_name}-%{version}.tar.gz +URL: http://pgpool.net +Source0: http://www.pgpool.net/download.php?f=pgpool-II-3.1.2.tar.gz Source1: pgpool.service Source2: pgpool.sysconfig Patch1: pgpool-3.1-conf.sample.patch From 9fbcd5f2bc8a31b2d5868a303e8a1e145db9dab0 Mon Sep 17 00:00:00 2001 From: Devrim GUNDUZ Date: Tue, 24 Apr 2012 00:53:59 +0300 Subject: [PATCH 4/5] - Update to 3.1.3, per changes described at: http://www.pgpool.net/docs/pgpool-II-3.1.3/doc/NEWS.txt --- .gitignore | 2 +- postgresql-pgpool-II.spec | 6 +++++- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2a03744..ebf58aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/pgpool-II-3.1.2.tar.gz +/pgpool-II-3.1.3.tar.gz diff --git a/postgresql-pgpool-II.spec b/postgresql-pgpool-II.spec index bfbd0ee..9992fd2 100644 --- a/postgresql-pgpool-II.spec +++ b/postgresql-pgpool-II.spec @@ -2,7 +2,7 @@ Summary: Pgpool is a connection pooling/replication server for PostgreSQL Name: postgresql-%{short_name} -Version: 3.1.2 +Version: 3.1.3 Release: 1%{?dist} License: BSD Group: Applications/Databases @@ -142,6 +142,10 @@ fi %changelog +* Tue Apr 24 2012 Devrim GUNDUZ - 3.1.3-1 +- Update to 3.1.3, per changes described at: + http://www.pgpool.net/docs/pgpool-II-3.1.3/doc/NEWS.txt + * Tue Mar 27 2012 Devrim Gunduz - 3.1.2-1 - update to 3.1.2 diff --git a/sources b/sources index 1e9a537..477c549 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4c0bbf0544c8b6f219501730d711e519 pgpool-II-3.1.2.tar.gz +dbb591a8aa3c3bd1e689f41a7638b9ee pgpool-II-3.1.3.tar.gz From 29750296f746d82b10418ae561b149d0ab1a4ed6 Mon Sep 17 00:00:00 2001 From: Devrim GUNDUZ Date: Tue, 24 Apr 2012 01:29:08 +0300 Subject: [PATCH 5/5] re-upload tarball --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 477c549..11794a0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dbb591a8aa3c3bd1e689f41a7638b9ee pgpool-II-3.1.3.tar.gz +3094f4a8cc24a7ff5e40e37b1db243e7 pgpool-II-3.1.3.tar.gz