Add different pgpool.sysconfig file for RHEL6 and RHEL7.
authorpengbo <pengbo@sraoss.co.jp>
Tue, 31 Oct 2017 03:26:15 +0000 (12:26 +0900)
committerpengbo <pengbo@sraoss.co.jp>
Tue, 31 Oct 2017 04:12:10 +0000 (13:12 +0900)
In RHEL6, the "-n" option is needed to redirect log.

Reported in bug 343.

src/pgpool.spec
src/redhat/pgpool_rhel6.sysconfig [new file with mode: 0644]
src/redhat/pgpool_rhel7.sysconfig [moved from src/redhat/pgpool.sysconfig with 100% similarity]

index 397d0feaf5bb15fbd261d0f024b0c9cc124e75de..d745d3c7ca9b47bd4acd8d75bcb1470380847359 100644 (file)
@@ -27,10 +27,11 @@ Vendor:         Pgpool Global Development Group
 URL:            http://www.pgppol.net/
 Source0:        pgpool-II-%{version}.tar.gz
 Source1:        pgpool.init
-Source2:        pgpool.sysconfig
+Source2:        pgpool_rhel6.sysconfig
 %if %{systemd_enabled}
 Source3:        pgpool.service
 %endif
+Source4:        pgpool_rhel7.sysconfig
 Patch1:         pgpool-II-head.patch
 %if %{pg_version} >=94 && %{rhel} >= 7
 Patch2:         pgpool_socket_dir.patch
@@ -134,7 +135,11 @@ install -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/pgpool
 %endif
 
 install -d %{buildroot}%{_sysconfdir}/sysconfig
-install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool
+%if 0%{rhel} && 0%{rhel} <= 6
+    install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool
+%else
+    install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/pgpool
+%endif
 
 # nuke libtool archive and static lib
 rm -f %{buildroot}%{_libdir}/libpcp.{a,la}
diff --git a/src/redhat/pgpool_rhel6.sysconfig b/src/redhat/pgpool_rhel6.sysconfig
new file mode 100644 (file)
index 0000000..221869e
--- /dev/null
@@ -0,0 +1,7 @@
+# Options for pgpool
+
+# -n: don't run in daemon mode. does not detatch control tty
+# -d: debug mode. lots of debug information will be printed
+
+#OPTS=" -d -n"
+OPTS=" -n"