Hello Bron,
I don't wanna stress you up, but do you have some new news for my problem?
I realised right now, that I didn't sent my answer to your questions to
the mailing list, sorry for that.
I still have the same sync_client problems.
Regards,
Darius
-------- Original Message --------
Subject: Re: sync_client general protection fault
Date: Sat, 21 Jan 2012 14:50:34 +0100
From: Darius Spitznagel <d.spitzna...@goodbytez.de>
To: Bron Gondwana <br...@fastmail.fm>
Hello Bron,
thank you for your quick answer.
I mostly do my own backports when needed, so i took the cyrus-imapd
sources from testing (wheezy, right now 2.4.12-2) and copied the
debian-directory from there into the original sources from
cyrus-imapd-2.4.13 and made some necessary changes to some files like
changelog there and renamed the source-dir so dpkg-buildpackage won't blame.
So the configure flags are the same like for cyrus-imapd-2.4.12 from wheezy.
I have attached the debian rules file for you.
Sorry, i have no skills in perl, so I d'ont know how to implement your
core dump trace.
The init script in the debian cyrus-imapd package ist written in bash.
Regards,
Darius
On 21.01.2012 13:31, Bron Gondwana wrote:
On Sat, Jan 21, 2012, at 01:09 PM, Darius Spitznagel wrote:
Hello,
i have a test-system with 2 cyrus mail servers (squeeze and
squeeze-slave) running cyrus-imapd 2.4.13.
When plaintext logins are not allowed (allowplaintext: no) sync_client
crashes after some time.
Are you capturing core files? A stack trace would help a lot. To
capture core files you usually need to set a ulimit and chdir to
somewhere that Cyrus can write to. We do (on Debian, in the init
script which is Perl):
# Setup core dumping
chdir "$CONFDIR/cores";
if (-f "/proc/sys/kernel/core_uses_pid") {
system("echo 1>/proc/sys/kernel/core_uses_pid");
}
# Start master process, and save pid
# (limit core dumps to 400M, avoid possible IO flood on core dump)
system("ulimit -c 409600&& ulimit -n 8192&& $DAEMON -l 255 -p $PIDFILE -d
$SLOT_CONFIG");
Here is what the kernel log shows after crash...
Jan 18 18:36:08 squeeze cyrus/sync_client[19784]: sync_client RESTART
succeeded
Jan 18 18:36:08 squeeze kernel: [20819.197061] sync_client[19784]
general protection ip:7f1fcef7d1f9 sp:7fffaa8f4e10 error:0 in
libcrypto.so.0.9.8[7f1fcee6c000+175000]
Jan 21 12:10:04 squeeze-slave cyrus/sync_client[18798]: sync_client
RESTART succeeded
Jan 21 12:10:04 squeeze-slave kernel: [125161.364980] sync_client[18798]
general protection ip:7f9db3cbe1f9 sp:7fff8b8ba9c0 error:0 in
libcrypto.so.0.9.8[7f9db3bad000+175000]
So it looks like we're not re-initializing the crypto library properly
in a "RESTART". That's definitely possible.
Both servers are configured as sync_client and sync_server, so they
replicate each other.
I KNOW this is not recommended (on our productive-system we have this
running over 2 years now without any problems but with "plaintext logins
allowed" because of one stupid app which can't handle encrypted
connections).
To prevent any problems only one server has the "magic"
failover-ip-address which allows access.
We ran something like this for quite a while ... it's really not too bad
unless you have things happening on the replica (reconstructs in particular
can get messy)
At some point, this will become the recommended configuration, once we
iron out the remaining risk points.
Both servers are runnung debian squeeze and using ldap authentication
via saslauthd.
cyrus-imapd is compiled with openssl and openldap with gnutls (installed
from apt-repo).
Can you give me your configure flags as well, just to help with debugging.
I won't get to this today, but I am very interested in making it work!
Thanks,
Bron.
#!/usr/bin/make -f
# debian/rules for CMU Cyrus IMAP version 2.4
# GNU copyright 1997 by Joey Hess.
# Copyright (c) 2001,2010 by Henrique de Moraes Holschuh
# Published under the GNU GPL license
# Based on previous work by Michael-John Turner <m...@debian.org>,
# David Parker <da...@neongoat.com>
#
#
# Please refer to debian/README.source for instructions
# TODO: needs update
#
#Hardening Wrapper
export DEB_BUILD_HARDENING=1
# DebHelper control
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git
export MAINPKG=cyrus-common-2.4
export DOCPKG=cyrus-doc-2.4
export TMPPKG := $(CURDIR)/debian/tmp
export PKGDIR := $(CURDIR)/debian/$(MAINPKG)
export DOCDIR := $(CURDIR)/debian/$(DOCPKG)/usr/share/doc/$(DOCPKG)
CFLAGS=-Wall -Wextra -g -fno-strict-aliasing -pipe $(if $(findstring
noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2)
LDFLAGS=-Wl,-z,defs -Wl,--as-needed
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
# Extra version information to add to Cyrus IMAPd ID
DEBVERSION ?= $(shell LC_ALL=C dpkg-parsechangelog | sed -ne 's/^Version:
\(.*-\)/\1/p')
EXTRA_IDENT := Debian-$(DEBVERSION)
# DB engine version
export BDB_VERSION ?= $(shell LC_ALL=C dpkg-query -l 'libdb[45].[0-9]-dev' |
grep ^ii | sed -e 's|.*\s\libdb\([45]\.[0-9]\)-dev\s.*|\1|')
DBENGINE := BerkeleyDB$(BDB_VERSION)
CONFFLAGS =
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
# Other oddities
ifneq (,$(findstring strict,$(DEB_BUILD_OPTIONS)))
CONFFLAGS += --enable-warnings-are-errors
endif
%:
dh --with quilt $@
override_dh_auto_clean:
dh_auto_clean
rm -f build-indep-stamp build-arch-stamp configure-stamp
install-arch-stamp install-indep-stamp build-stamp build-prepare-stamp
rm -f config.h config.cache config.status config.log stamp-config
confdefs.h
rm -f mkinstalldirs
rm -f netnews/Makefile perl/imap/Makefile.old
perl/sieve/managesieve/Makefile.old snmp/Makefile Makefile et/Makefile
rm -f doc/pod2htm*
rm -f master/makedepend.log
rm -f debian/cyrus-db-types.txt debian/cyrus-hardwired-config.txt
debian/README.configure-options
override_dh_auto_configure:
# Rebuild the build system
autoreconf -I cmulocal -f -i
automake -f -a 2>/dev/null || true
dh_auto_configure CFLAGS="$(CFLAGS)" \
LDFLAGS="$(LDFLAGS)" -- \
$(CONFFLAGS) \
--with-extraident=$(EXTRA_IDENT) \
--prefix=/usr/share --exec-prefix=/usr --libexecdir=/usr/sbin \
--bindir=/usr/sbin --sbindir=/usr/sbin \
--includedir=/usr/include/cyrus --mandir=/usr/share/man \
--datadir=/usr/share/cyrus --sysconfdir=/etc \
--sharedstatedir=/usr/share/cyrus \
--localstatedir=/var/lib/cyrus \
--mandir=/usr/share/man \
--with-cyrus-prefix=/usr/lib/cyrus \
--with-lock=fcntl \
--with-perl=/usr/bin/perl \
--with-openssl=/usr \
--with-bdb=db-$(BDB_VERSION) \
--with-bdb-libdir=/usr/lib --with-bdb-incdir=/usr/include \
--enable-murder --enable-nntp --enable-replication \
--disable-listext --with-sasl=/usr \
--enable-idled \
--with-cyrus-user=cyrus --with-cyrus-group=mail \
--with-com_err="" \
--with-pidfile=/var/run/cyrmaster.pid \
--with-syslogfacility=MAIL \
--with-ucdsnmp=/usr \
--with-ldap=/usr
echo 'To build this package, configure was called as follows:' \
> debian/README.configure-options
grep '^ac_cs_config=' config.status \
| sed -e 's/^ac_cs_config="/configure /;s/"$$//' \
>> debian/README.configure-options
sed -i 's/ -lsensors//' master/Makefile
override_dh_auto_build:
PERL_MM_OPT="INSTALLDIRS=vendor" $(MAKE)
# store database configuration for possible automatic
# upgrading later
echo "DBENGINE $(DBENGINE)" >>debian/cyrus-db-types.txt
grep '_db"' lib/imapoptions \
| cut -d, -f1-2 | sed -e 's/{ "//;s/_db", "/ /;s/"$$//' \
| sed -e 's/^tls.* /TLS /;s/^subs.* /SUBS /;s/^seen.* /SEEN /;s/^pts.*
/PTS /;s/^mbox.* /MBOX /'\
| awk '{printf("%s %s\n",toupper($$1),$$2);}' \
>>debian/cyrus-db-types.txt
mv debian/cyrus-db-types.txt debian/cyrus-db-types.txt.old \
&& sort -u < debian/cyrus-db-types.txt.old > debian/cyrus-db-types.txt \
&& rm debian/cyrus-db-types.txt.old
#
# store some useful state about the current package
echo "PACKAGE_VERSION $(DEBVERSION)" >debian/cyrus-hardwired-config.txt
if grep -q -s -n -E
'^[[:space:]]*#define[[:space:]]+USE_DIR_FULL[[:space:]]+1' config.h ; then \
echo "USE_DIR_FULL 1" >>debian/cyrus-hardwired-config.txt ;\
else \
echo "USE_DIR_FULL 0" >>debian/cyrus-hardwired-config.txt ;\
fi
# former build-indep
cd doc &&\
pod2man ../perl/sieve/scripts/sieveshell.pl > ../man/sieveshell.1 &&\
fig2dev -L png murder.fig murder.png &&\
rm -f groff-html-*.png pod2htm*
cd doc &&\
mkdir -p man &&\
for man in ../man/*.[1-9] ../debian/*.[1-9]; do \
echo "Generating html manpage for $$man..."; \
groff -man -Thtml $$man > man/`basename $$man`.html; \
done
pod2html perl/imap/cyradm.sh > doc/man/cyradm.1.html
rm -f pod2htm*
override_dh_auto_install:
dh_auto_install -- DESTDIR=$(TMPPKG)
# fix totaly broken location of the include files;
# while at it, also avoid namespace collision, and move
# lots of admin-only/system-only stuff to sbin and lib
# also, do the renaming needed for alternatives
# and fix the weird side-effect of setting the proper cyrus
# location in configure.
install -d -m 755 $(TMPPKG)/usr/sbin
install -m 755 debian/cyrus $(TMPPKG)/usr/sbin
# This is handled by /usr/sbin/cyrus tool from now
#
#for i in master reconstruct quota deliver ; do \
# mv $(TMPPKG)/usr/lib/cyrus/bin/$$i $(TMPPKG)/usr/sbin/cyr$$i ;\
#done
for i in master deliver ; do \
mv $(TMPPKG)/usr/lib/cyrus/bin/$$i $(TMPPKG)/usr/sbin/cyr$$i ;\
done
#for i in mbpath ctl_mboxlist ctl_deliver ctl_cyrusdb squatter \
# tls_prune ipurge cyrdump cvt_cyrusdb chk_cyrus arbitron \
# cyr_expire unexpunge sync_client sync_reset cyr_synclog \
# cyr_dbtool cyr_df ; do \
# mv $(TMPPKG)/usr/lib/cyrus/bin/$$i $(TMPPKG)/usr/sbin/$$i ;\
#done
for i in mbpath ctl_mboxlist ctl_deliver ctl_cyrusdb squatter \
tls_prune ipurge cyrdump cvt_cyrusdb chk_cyrus arbitron \
cyr_expire unexpunge sync_client sync_reset cyr_synclog \
cyr_dbtool cyr_df cyrus-makedirs cyrreconstruct cyrquota; do \
ln -fs cyrus $(TMPPKG)/usr/sbin/$$i ;\
done
install -d -m 755 $(TMPPKG)/usr/include
mv $(TMPPKG)/usr/share/include/cyrus $(TMPPKG)/usr/include
#mv $(TMPPKG)/bin/* $(TMPPKG)/usr/bin
# Move the perl crap to a saner place
install -d -m 755 $(TMPPKG)/usr/lib
install -d -m 755 $(TMPPKG)/usr/share/perl5
#mv $(TMPPKG)/lib/perl5/Cyrus $(TMPPKG)/usr/share/perl5/Cyrus
#mv $(TMPPKG)/lib/* $(TMPPKG)/usr/lib
# for stuff in /etc
install -d -m 755 $(TMPPKG)/etc/cyrus $(TMPPKG)/etc/pam.d
install -m 644 debian/imapd.conf $(TMPPKG)/etc
install -m 644 debian/cyrus.conf $(TMPPKG)/etc
(cd debian ; for i in *.pam ;\
do install -m 644 $$i $(TMPPKG)/etc/pam.d/$${i%.pam} ;\
done)
# We rename some utils, so we need to sort out the manpages
for i in master deliver ; do \
mv $(TMPPKG)/usr/share/man/man8/$$i.8
$(TMPPKG)/usr/share/man/man8/cyr$$i.8 ; \
done
# Rename all other manpages to have cyrus- prefix, but keep
compatibility symlinks
for i in master reconstruct quota deliver \
mbpath ctl_mboxlist ctl_deliver ctl_cyrusdb squatter \
tls_prune ipurge cyrdump cvt_cyrusdb chk_cyrus arbitron \
cyr_expire unexpunge sync_client sync_reset cyr_synclog \
cyr_dbtool cyr_df ; do \
mv $(TMPPKG)/usr/share/man/man8/$$i.8
$(TMPPKG)/usr/share/man/man8/cyrus-$${i}.8 ; \
ln -s cyrus-$$i.8 $(TMPPKG)/usr/share/man/man8/$$i.8 ; \
done
# And add our own manpages
install -d -m 755 $(TMPPKG)/usr/share/man/man8
install -m 644 debian/cyrdump.8
$(TMPPKG)/usr/share/man/man8/cyrus-dump.8
install -m 644 debian/cyrus-makedirs.8
$(TMPPKG)/usr/share/man/man8/cyrus-makedirs.8
install -m 644 debian/arbitronsort.8
$(TMPPKG)/usr/share/man/man8/cyrus-arbitronsort.8
# SNMP files
install -d -m 755 $(TMPPKG)/usr/share/snmp/mibs
install -m 644 master/CYRUS-MASTER.mib
$(TMPPKG)/usr/share/snmp/mibs/CYRUS-MASTER-MIB.txt
# Install cyradm icons
install -d -m 755 $(TMPPKG)/usr/share/icons/mini
install -m 644 debian/cyradm-32x32.xpm
$(TMPPKG)/usr/share/icons/cyradm.xpm
install -m 644 debian/cyradm-16x16.xpm
$(TMPPKG)/usr/share/icons/mini/cyradm.xpm
# Install debian-provided scripts
install debian/cyrus-makedirs $(TMPPKG)/usr/lib/cyrus/bin/makedirs
install -m 755 debian/cyrus-upgrade-db
$(TMPPKG)/usr/lib/cyrus/bin/upgrade-db
install -m 644 debian/get-backtrace.gdb
$(TMPPKG)/usr/lib/cyrus/get-backtrace.gdb
# and logcheck files
install -d -m 755 $(TMPPKG)/etc/logcheck/ignore.d.server/
$(TMPPKG)/etc/logcheck/violations.ignore.d/
install -m 644 debian/logcheck.ignore \
$(TMPPKG)/etc/logcheck/ignore.d.server/cyrus-imapd
install -m 644 debian/logcheck.violations.ignore \
$(TMPPKG)/etc/logcheck/violations.ignore.d/cyrus-imapd
# Install the stuff needed for upgrades
install -d -m 755 $(TMPPKG)/usr/lib/cyrus/upgrade
for i in convert-sieve.pl dohash rehash undohash translatesieve \
upgradesieve masssievec; do \
install -m 755 tools/$$i $(TMPPKG)/usr/lib/cyrus/upgrade ;\
done
install -m 644 debian/cyrus-db-types.upgrading_from_1.5.txt
$(TMPPKG)/usr/lib/cyrus/upgrade
# And other upgrade helpers
install -m 644 debian/cyrus-db-types.txt
debian/cyrus-hardwired-config.txt \
$(PKGDIR)/usr/lib/cyrus
# And other misc useful tools
install -m 755 tools/arbitronsort.pl
$(TMPPKG)/usr/lib/cyrus/bin/arbitronsort
# Install imtest and its symlinks
mv $(TMPPKG)/usr/bin/imtest $(CURDIR)/debian/cyrus-clients-2.4/usr/bin
for i in $(TMPPKG)/usr/bin/*test ; do \
rm -f "$$i" || true ;\
(cd $(CURDIR)/debian/cyrus-clients-2.4/usr/bin &&\
ln -s imtest `basename $$i`) ;\
done
# Install the html docs and examples
install -d -m 755 $(DOCDIR)/html
install -m 644 doc/*.html doc/murder.png $(DOCDIR)/html
cp -a doc/man $(DOCDIR)/html
cp -a debian/examples $(DOCDIR)
install -m 644 doc/cyrusv2.mc $(DOCDIR)/examples
#
# Install contrib/ files
install -d -m 755 $(DOCDIR)/contrib
xargs < debian/cyrus-common-2.4.contrib -rti cp -r '{}'
$(DOCDIR)/contrib
override_dh_installdocs:
dh_installdocs -p cyrus-common -p cyrus-admin-2.4 -p cyrus-doc-2.4
dh_installdocs -p cyrus-clients-2.4 -p libcyrus-imap-perl24
dh_installdocs -p cyrus-common-2.4 --link-doc=cyrus-common
for i in clients imapd pop3d admin murder replication nntpd doc dev ;
do \
dh_installdocs -p cyrus-$$i --link-doc=cyrus-$$i-2.4; \
done
dh_installdocs -p libcyrus-imap-perl --link=libcyrus-imap-perl24
# Install docs for transitional packages
for p in common doc imapd pop3d admin murder nntpd clients dev ; do \
dh_installdocs -p cyrus-$$p-2.2 --link-doc=cyrus-common; \
done
dh_installdocs -p libcyrus-imap-perl22 --link=cyrus-common
override_dh_installinit:
dh_installinit -p cyrus-common --noscripts --name=cyrus-imapd
dh_installinit -p cyrus-common-2.4 --onlyscripts --name=cyrus-imapd
override_dh_installexamples:
dh_installexamples -p cyrus-admin-2.4
dh_installexamples -p libcyrus-imap-perl24 -p cyrus-clients-2.4
override_dh_installchangelogs:
dh_installchangelogs -p cyrus-admin-2.4 doc/changes.html
dh_installchangelogs -p cyrus-doc-2.4
dh_installchangelogs -p cyrus-common -p cyrus-clients-2.4
doc/changes.html
dh_installchangelogs -p libcyrus-imap-perl24 perl/imap/Changes
override_dh_installcron:
dh_installcron --name=cyrus-imapd