Accepting request 42260 from network:ha-clustering:Factory

Copy from network:ha-clustering:Factory/csync2 based on submit request 42260 from user tserong

OBS-URL: https://build.opensuse.org/request/show/42260
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/csync2?expand=0&rev=1
This commit is contained in:
OBS User autobuild 2010-06-29 16:02:56 +00:00 committed by Git OBS Bridge
commit a8d2769fe0
9 changed files with 5469 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

File diff suppressed because it is too large Load Diff

3
csync2-1.34.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:32b250dd4a0353f71015c5c3961174b975dd5e799e4a084e8f6d00792bd8c833
size 222765

49
csync2-README.quickstart Normal file
View File

@ -0,0 +1,49 @@
Getting started with csync2 :
There's no need to define the port for csync2 in /etc/services, although the
manual says so. Port 30865/tcp is defined in /etc/xinetd.d/csync2. All commands
detailed here need to be executed as root, so be extra careful.
The config file for csync2 is /etc/csync2/csync2.cfg. Here is an example :
mygroup {
host host1;
host host2;
key /etc/csync2/mygroup.key;
include /etc/csync2/csync2.cfg;
include /etc/testfile;
}
This will sync the csync2 configuration and /etc/testfile between host1 and
host2. Create the file on host1. Note that hostnames need to be the FQDN
returned by "hostname".
Generate the pre-shared key used for authentication :
csync2 -k /etc/csync2/mygroup.key
Copy the configuration file and the pre-shared key to host2:
scp /etc/csync2/csync2.cfg /etc/csync2/mygroup.key host2:/etc/csync2/
The SSL key and certificate are generated upon package installation, but you
can replace them with your own if you like. The files are :
/etc/csync2/csync2_ssl_key.pem
/etc/csync2/csync2_ssl_cert.pem
The csync2 service is disabled by default. To start it on both your hosts :
chkconfig csync2 on
chkconfig --level 345 xinetd on
service xinetd restart
If you are running iptables, you need to open tcp port 30865 on both hosts so
that the other host can connect.
Now you should be able to run and initial verbose sync on both hosts :
csync2 -xv
Once everything looks good, you can add a file with the following line as
/etc/cron.d/csync2 or add it to /etc/crontab :
*/5 * * * * root csync2 -x
Happy syncing!

19
csync2-fix-xinetd.patch Normal file
View File

@ -0,0 +1,19 @@
--- csync2-1.33/csync2.xinetd.fix-xinetd 2007-01-24 21:18:04.000000000 +0100
+++ csync2-1.33/csync2.xinetd 2007-01-24 21:19:47.000000000 +0100
@@ -1,4 +1,4 @@
-# default: on
+# default: off
# description: csync2
service csync2
{
@@ -9,7 +9,9 @@
group = root
server = /usr/sbin/csync2
server_args = -i
+ port = 30865
+ type = UNLISTED
#log_on_failure += USERID
- disable = no
+ disable = yes
# only_from = 192.168.199.3 192.168.199.4
}

16
csync2.changes Normal file
View File

@ -0,0 +1,16 @@
-------------------------------------------------------------------
Tue Jun 8 00:59:40 UTC 2010 - tserong@novell.com
- Fix build against gnutls 2.8 in factory (integrated patch from
http://bugs.gentoo.org/show_bug.cgi?id=274213)
-------------------------------------------------------------------
Mon Dec 14 16:57:21 CET 2009 - ro@suse.de
- fix build against current openssl
-------------------------------------------------------------------
Fri Dec 4 09:58:35 UTC 2009 - jshi@novell.com
- Init import of csync2 for DRBD configuration file sync (fate#307419)

118
csync2.spec Normal file
View File

@ -0,0 +1,118 @@
#
# spec file for package csync2 (Version 1.34)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Summary: Cluster synchronization tool
Name: csync2
Version: 1.34
Release: 1
Group: Productivity/Clustering/HA
License: GPLv2+ ; LGPLv2.1+
Url: http://oss.linbit.com/csync2/
Source0: http://oss.linbit.com/csync2/%{name}-%{version}.tar.gz
Source1: csync2-README.quickstart
Patch0: csync2-fix-xinetd.patch
Patch1: fix-missing-sentinels.diff
%if 0%{?suse_version} > 1120
Patch2: csync2-1.34-pure-gnutls-r2.patch
BuildRequires: pkg-config
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): openssl
Requires: xinetd libgnutls26 libgnutls-extra26 gnutls sqlite2 librsync libtasn1-3
BuildRequires: bison flex libgnutls-devel libgnutls-extra-devel librsync libtasn1-devel sqlite2-devel
%description
Csync2 is a cluster synchronization tool. It can be used to keep files
on multiple hosts in a cluster in sync. Csync2 can handle complex
setups with much more than just 2 hosts, handle file deletions and can
detect conflicts. It is expedient for HA-clusters, HPC-clusters, COWs
and server farms.
Authors:
--------
Clifford Wolf <clifford@clifford.at>
%prep
%setup -q
%patch0 -p1 -b .fix-xinetd
%patch1 -p1
%if 0%{?suse_version} > 1120
%patch2 -p1
%endif
install -p -m 644 %{SOURCE1} README.quickstart
%build
%configure --sysconfdir=%{_sysconfdir}/csync2
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_var}/lib/csync2
install -p -D -m 644 csync2.xinetd %{buildroot}%{_sysconfdir}/xinetd.d/csync2
# We need these empty files to be able to %%ghost them
touch %{buildroot}%{_sysconfdir}/csync2/csync2_ssl_key.pem
touch %{buildroot}%{_sysconfdir}/csync2/csync2_ssl_cert.pem
%clean
rm -rf %{buildroot}
%post
umask 077
if [ ! -f %{_sysconfdir}/csync2/csync2_ssl_key.pem ]; then
/usr/bin/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %{_sysconfdir}/csync2/csync2_ssl_key.pem 2>/dev/null
fi
FQDN=`hostname`
if [ "x${FQDN}" = "x" ]; then
FQDN=localhost.localdomain
fi
if [ ! -f %{_sysconfdir}/csync2/csync2_ssl_cert.pem ]; then
cat << EOF | /usr/bin/openssl req -new -key %{_sysconfdir}/csync2/csync2_ssl_key.pem -x509 -days 3000 -out %{_sysconfdir}/csync2/csync2_ssl_cert.pem 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganization
SomeName
name@example.com
EOF
fi
%preun
# Cleanup all databases upon last removal
if [ $1 -eq 0 ]; then
%{__rm} -f %{_var}/lib/csync2/*
fi
%files
%defattr(-,root,root,-)
%doc README README.quickstart AUTHORS COPYING paper.pdf
%dir %{_sysconfdir}/csync2/
%config(noreplace) %{_sysconfdir}/csync2/csync2.cfg
%config(noreplace) %{_sysconfdir}/xinetd.d/csync2
%ghost %config %{_sysconfdir}/csync2/csync2_ssl_key.pem
%ghost %config %{_sysconfdir}/csync2/csync2_ssl_cert.pem
%{_sbindir}/csync2
%{_sbindir}/csync2-compare
%{_mandir}/man1/csync2.1*
%dir %{_var}/lib/csync2/
%changelog

View File

@ -0,0 +1,13 @@
Index: action.c
===================================================================
--- csync2-1.34/action.c 2007-07-25 05:04:18.000000000 +0800
+++ csync2-1.34/action.c 2009-12-04 17:51:47.000000000 +0800
@@ -107,7 +107,7 @@
/* 1 */ open(logfile_clr, O_WRONLY|O_CREAT|O_APPEND, 0666);
/* 2 */ open(logfile_clr, O_WRONLY|O_CREAT|O_APPEND, 0666);
- execl("/bin/sh", "sh", "-c", real_command, 0);
+ execl("/bin/sh", "sh", "-c", real_command, NULL);
_exit(127);
}