пятница, 14 января 2011 г.

repmgr FreeBSD port

I've just managed to create initial prototype of repmgr port for FreeBSD. Port compiles, but repmgrd dumps core for unknown reason... Need to investigate. Shell archive of the port is provided.

Updated: repmgrd works fine with included patch.


# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# databases/postgresql-repmgr
# databases/postgresql-repmgr/Makefile
# databases/postgresql-repmgr/pkg-descr
# databases/postgresql-repmgr/distinfo
# databases/postgresql-repmgr/pkg-plist
# databases/postgresql-repmgr/files
# databases/postgresql-repmgr/files/patch-repmgrd.c
#
echo c - databases/postgresql-repmgr
mkdir -p databases/postgresql-repmgr > /dev/null 2>&1
echo x - databases/postgresql-repmgr/Makefile
sed 's/^X//' >databases/postgresql-repmgr/Makefile << '48fb6f3f1b95d8369d928a104f7bd6a3'
X# New ports collection makefile for: repmgr
X# Date created: January 15, 2011
X
XPORTNAME= postgresql-repmgr
XPORTVERSION= 1.0.0
XPORTREVISION= 0
XCATEGORIES= databases
XMASTER_SITES= http://projects.2ndquadrant.it/sites/default/files/
X#MASTER_SITE_SUBDIR= sites/default/files/
XDISTNAME= repmgr-${PORTVERSION}
X
XMAINTAINER= alp@sfedu.ru
XCOMMENT= PostgreSQL repmgr
X
XBUILD_DEPENDS+= postgresql-server>=9.0:${PORTSDIR}/databases/postgresql90-server
XRUN_DEPENDS:= ${BUILD_DEPNDS}
XRUN_DEPENDS+= rsync:${PORTSDIR}/net/rsync
X
XUSE_GMAKE= yes
XMAKE_ENV= USE_PGXS=1
X
XPORTDOCS= README.*
X
Xdo-install:
X ${INSTALL_PROGRAM} ${WRKSRC}/repmgr ${PREFIX}/bin
X ${INSTALL_PROGRAM} ${WRKSRC}/repmgrd ${PREFIX}/sbin
X.if !defined(NOPORTDOCS)
X @${MKDIR} ${DOCSDIR}
X ${INSTALL_DATA} ${WRKSRC}/README.rst ${DOCSDIR}
X.endif
X.if !defined(NOPORTDATA)
X @${MKDIR} ${DATADIR}
X ${INSTALL_DATA} ${WRKSRC}/repmgr.conf ${DATADIR}
X ${INSTALL_DATA} ${WRKSRC}/repmgr.sql ${DATADIR}
X.endif
X
X.include <bsd.port.mk>
48fb6f3f1b95d8369d928a104f7bd6a3
echo x - databases/postgresql-repmgr/pkg-descr
sed 's/^X//' >databases/postgresql-repmgr/pkg-descr << '4003202a12e35bb4d428938652326a06'
XPostgreSQL replication manager (repmgr)
X
XWWW: http://projects.2ndquadrant.com/repmgr
4003202a12e35bb4d428938652326a06
echo x - databases/postgresql-repmgr/distinfo
sed 's/^X//' >databases/postgresql-repmgr/distinfo << 'e1ae01bffabbb92bb754fc0eea6621aa'
XMD5 (repmgr-1.0.0.tar.gz) = e9a90058ff2ad81de20fd8dc7b8743f0
XSHA256 (repmgr-1.0.0.tar.gz) = b0345a9a32c3f3bab542c8d2ef72881f6f45b6c0d703f481998beb5755a1d79b
XSIZE (repmgr-1.0.0.tar.gz) = 35940
e1ae01bffabbb92bb754fc0eea6621aa
echo x - databases/postgresql-repmgr/pkg-plist
sed 's/^X//' >databases/postgresql-repmgr/pkg-plist << '1ca1316c7087064a99a71f8064202df0'
Xbin/repmgr
Xsbin/repmgrd
X%%DATADIR%%/repmgr.conf
X%%DATADIR%%/repmgr.sql
1ca1316c7087064a99a71f8064202df0
echo c - databases/postgresql-repmgr/files
mkdir -p databases/postgresql-repmgr/files > /dev/null 2>&1
echo x - databases/postgresql-repmgr/files/patch-repmgrd.c
sed 's/^X//' >databases/postgresql-repmgr/files/patch-repmgrd.c << '39954438281f6f4b810cfb628d4308b3'
X--- repmgrd.c 2010-12-06 05:09:48.000000000 +0300
X+++ repmgrd.c 2011-01-16 12:34:49.345998423 +0300
X@@ -173,7 +173,12 @@
X }
X
X /* close the connection to the database and cleanup */
X- CloseConnections();
X+ if (PQisBusy(primaryConn) == 1)
X+ CancelQuery();
X+ if (myLocalConn != NULL)
X+ PQfinish(myLocalConn);
X+ if (primaryConn != NULL && myLocalMode != PRIMARY_MODE)
X+ PQfinish(primaryConn);
X
X return 0;
X }
39954438281f6f4b810cfb628d4308b3
exit


Комментариев нет:

Отправить комментарий