From a5d41a30b63247eff6346632a61d9670fe3192f7 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Wed, 24 Oct 2012 16:54:46 -0700 Subject: [PATCH] Update the RPM support files. Includes a patch that puts all the log files into /var/log/bucardo by default. --- .gitignore | 2 +- dist/bucardo-logfiles.patch | 23 +++++++++++++++++++++++ dist/bucardo.init | 4 +--- dist/bucardo.spec | 8 +++++++- 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 dist/bucardo-logfiles.patch diff --git a/.gitignore b/.gitignore index 3a1d903f7..bceea330a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ MYMETA.* ## Git stuff *.blame -*.patch +/*.patch *.diff *.orig *.rej diff --git a/dist/bucardo-logfiles.patch b/dist/bucardo-logfiles.patch new file mode 100644 index 000000000..f126e6015 --- /dev/null +++ b/dist/bucardo-logfiles.patch @@ -0,0 +1,23 @@ +--- bucardo.schema.orig 2012-10-24 15:56:27.588314685 -0700 ++++ bucardo.schema 2012-10-24 15:55:52.119313660 -0700 +@@ -135,9 +135,9 @@ + log_showlevel|0|Show log level in the log output? + log_showline|0|Show line number in the log output? + log_showtime|3|Show timestamp in the log output? 0=off 1=seconds since epoch 2=scalar gmtime 3=scalar localtime +-log_conflict_file|bucardo_conflict.log|Name of the conflict detail log file ++log_conflict_file|/var/log/bucardo/bucardo_conflict.log|Name of the conflict detail log file + log_level|NORMAL|How verbose to make the logging. Higher is more verbose. +-warning_file|bucardo.warning.log|File containing all log lines starting with "Warning" ++warning_file|/var/log/bucardo/bucardo.warning.log|File containing all log lines starting with "Warning" + \. + + -- Versioning +@@ -161,7 +161,7 @@ + flatfile_dir|.|Directory to store the flatfile output inside of + host_safety_check||Regex to make sure we don't accidentally run where we should not + piddir|/var/run/bucardo|Directory holding Bucardo PID files +-reason_file|bucardo.restart.reason.log|File to hold reasons for stopping and starting ++reason_file|/var/log/bucardo/bucardo.restart.reason.log|File to hold reasons for stopping and starting + semaphore_table|bucardo_status|Table to let apps know a sync is ongoing + statement_chunk_size|10000|How many primary keys to shove into a single statement + stats_script_url|http://www.bucardo.org/|Location of the stats script diff --git a/dist/bucardo.init b/dist/bucardo.init index 9c7e02e6a..019f37880 100755 --- a/dist/bucardo.init +++ b/dist/bucardo.init @@ -30,7 +30,7 @@ SYSUSER=${SYSUSER-postgres} DBNAME=${DBNAME-bucardo} DBUSER=${DBUSER-bucardo} LOGDIR=${LOGDIR-/var/log/${NAME}} -PIDDIR=${LOGDIR-/var/run/${NAME}} +PIDDIR=${PIDDIR-/var/run/${NAME}} # Override defaults from /etc/sysconfig/bucardo, if file is present: [ -f /etc/sysconfig/${NAME} ] && . /etc/sysconfig/${NAME} @@ -41,8 +41,6 @@ if [ -z "$DBPORT" ]; then portopt=""; else portopt="--dbport $DBPORT"; fi bucardo_flags="--quiet ${hostopt} ${portopt} --dbname ${DBNAME} --dbuser ${DBUSER} --debugdir ${LOGDIR} --piddir ${PIDDIR}" RETVAL=0 -cd $LOGDIR - start() { # Make sure that bucardo is not already running: if [ -f "${PIDDIR}/bucardo.mc.pid" ]; then diff --git a/dist/bucardo.spec b/dist/bucardo.spec index 78cea350f..3f61a3ac6 100644 --- a/dist/bucardo.spec +++ b/dist/bucardo.spec @@ -2,7 +2,7 @@ %define sysuser postgres Name: bucardo Version: 4.99.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Postgres replication system for both multi-master and multi-slave operations Group: Applications/Databases @@ -13,6 +13,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source1: master-master-replication-example.txt Source2: bucardo.init +Patch0: bucardo-logfiles.patch BuildArch: noarch @@ -55,6 +56,7 @@ chown -R %{sysuser}:%{sysuser} /var/log/bucardo %prep %setup -q -n %{realname}-%{version} +%patch0 -p0 %build @@ -99,6 +101,10 @@ rm -rf %{buildroot} %{_initrddir}/%{name} %changelog +* Wed Oct 24 2012 David E. Wheeler - 4.99.5-3 +- Fixed the init script so that the `stop` command actually works. +- Added a patch to point all of the log files to the log directory. + * Tue Oct 2 2012 David E. Wheeler - 4.99.5-2 - Require postgres. - Add start script running as postgres. -- 2.39.5