diff --git a/bdii-run-full.patch b/bdii-run-full.patch index 915da4e..7459011 100644 --- a/bdii-run-full.patch +++ b/bdii-run-full.patch @@ -1,6 +1,6 @@ -diff -ur bdii-5.2.5.orig/bin/bdii-update bdii-5.2.5/bin/bdii-update ---- bdii-5.2.5.orig/bin/bdii-update 2011-09-04 19:20:12.000000000 +0200 -+++ bdii-5.2.5/bin/bdii-update 2011-09-04 19:25:20.213323406 +0200 +diff -ur bdii-5.2.12.orig/bin/bdii-update bdii-5.2.12/bin/bdii-update +--- bdii-5.2.12.orig/bin/bdii-update 2012-02-08 16:39:55.000000000 +0100 ++++ bdii-5.2.12/bin/bdii-update 2012-07-27 16:03:57.335533593 +0200 @@ -74,6 +74,9 @@ if ( not config.has_key('BDII_DAEMON') ): config['BDII_DAEMON'] = False @@ -20,129 +20,128 @@ diff -ur bdii-5.2.5.orig/bin/bdii-update bdii-5.2.5/bin/bdii-update pid_file.write("%s\n" % (str(os.getpid()))) pid_file.close() -diff -ur bdii-5.2.5.orig/etc/bdii.conf bdii-5.2.5/etc/bdii.conf ---- bdii-5.2.5.orig/etc/bdii.conf 2011-09-04 19:20:12.000000000 +0200 -+++ bdii-5.2.5/etc/bdii.conf 2011-09-04 19:25:20.214323393 +0200 +diff -ur bdii-5.2.12.orig/etc/bdii.conf bdii-5.2.12/etc/bdii.conf +--- bdii-5.2.12.orig/etc/bdii.conf 2011-11-02 17:05:05.000000000 +0100 ++++ bdii-5.2.12/etc/bdii.conf 2012-07-27 16:03:57.335533593 +0200 @@ -1,4 +1,5 @@ BDII_LOG_FILE=/var/log/bdii/bdii-update.log +BDII_PID_FILE=/var/run/bdii/bdii-update.pid BDII_LOG_LEVEL=ERROR BDII_LDIF_DIR=/var/lib/bdii/gip/ldif BDII_PROVIDER_DIR=/var/lib/bdii/gip/provider -@@ -9,4 +10,4 @@ - BDII_ARCHIVE_SIZE=0 - BDII_DELETE_DELAY=0 - BDII_USER=ldap --BDII_VAR_DIR=/var/run/bdii -+BDII_VAR_DIR=/var/lib/bdii -diff -ur bdii-5.2.5.orig/etc/bdii-slapd.conf bdii-5.2.5/etc/bdii-slapd.conf ---- bdii-5.2.5.orig/etc/bdii-slapd.conf 2011-09-04 19:20:12.000000000 +0200 -+++ bdii-5.2.5/etc/bdii-slapd.conf 2011-09-04 19:25:20.221323305 +0200 -@@ -13,23 +13,23 @@ - - pidfile /var/run/bdii/db/slapd.pid - argsfile /var/run/bdii/db/slapd.args +diff -ur bdii-5.2.12.orig/etc/bdii-slapd.conf bdii-5.2.12/etc/bdii-slapd.conf +--- bdii-5.2.12.orig/etc/bdii-slapd.conf 2012-02-08 11:00:50.000000000 +0100 ++++ bdii-5.2.12/etc/bdii-slapd.conf 2012-07-27 16:03:57.337533609 +0200 +@@ -11,9 +11,9 @@ + + allow bind_v2 + +-pidfile /var/run/bdii/slapd.pid +-argsfile /var/run/bdii/slapd.args -loglevel 0 ++pidfile /var/run/bdii/db/slapd.pid ++argsfile /var/run/bdii/db/slapd.args +loglevel 0 idletimeout 120 sizelimit unlimited timelimit 2400 - - ####################################################################### --# bdb database definitions -+# hdb database definitions - ####################################################################### +@@ -24,11 +24,11 @@ database hdb - cachesize 150000 - dbnosync suffix "o=grid" --checkpoint 131072 60 -+checkpoint 131072 60 +-cachesize 30000 ++cachesize 30000 + checkpoint 1024 0 + dbnosync rootdn "o=grid" - rootpw secret --directory /var/run/bdii/db -+directory /var/lib/bdii/db +-rootpw fc78ApbTj ++rootpw secret + directory /var/lib/bdii/db/grid index GlueCEAccessControlBaseRule eq - index GlueCESEBindCEUniqueID eq -@@ -61,7 +61,7 @@ +@@ -57,11 +57,11 @@ + + database hdb suffix "o=glue" +-cachesize 3000 ++cachesize 3000 + checkpoint 1024 0 + dbnosync rootdn "o=glue" - rootpw secret --directory /var/run/bdii/db/glue2 -+directory /var/lib/bdii/db/glue2 +-rootpw fc78ApbTj ++rootpw secret + directory /var/lib/bdii/db/glue index GLUE2GroupID eq - index GLUE2ExtensionLocalID eq -@@ -91,8 +91,8 @@ - cachesize 60 - dbnosync +@@ -90,10 +90,10 @@ + ####################################################################### + database hdb suffix "o=infosys" --checkpoint 131072 60 -+checkpoint 131072 60 +-cachesize 10 ++cachesize 10 + checkpoint 1024 0 + dbnosync rootdn "o=infosys" - rootpw secret --directory /var/run/bdii/db/stats -+directory /var/lib/bdii/db/stats +-rootpw fc78ApbTj ++rootpw secret + directory /var/lib/bdii/db/stats -diff -ur bdii-5.2.5.orig/etc/bdii-top-slapd.conf bdii-5.2.5/etc/bdii-top-slapd.conf ---- bdii-5.2.5.orig/etc/bdii-top-slapd.conf 2011-09-04 19:20:12.000000000 +0200 -+++ bdii-5.2.5/etc/bdii-top-slapd.conf 2011-09-04 19:25:20.221323305 +0200 -@@ -13,7 +13,7 @@ +diff -ur bdii-5.2.12.orig/etc/bdii-top-slapd.conf bdii-5.2.12/etc/bdii-top-slapd.conf +--- bdii-5.2.12.orig/etc/bdii-top-slapd.conf 2012-02-08 11:00:50.000000000 +0100 ++++ bdii-5.2.12/etc/bdii-top-slapd.conf 2012-07-27 16:03:57.338533616 +0200 +@@ -11,9 +11,9 @@ - pidfile /var/run/bdii/db/slapd.pid - argsfile /var/run/bdii/db/slapd.args + allow bind_v2 + +-pidfile /var/run/bdii/slapd.pid +-argsfile /var/run/bdii/slapd.args -loglevel 0 ++pidfile /var/run/bdii/db/slapd.pid ++argsfile /var/run/bdii/db/slapd.args +loglevel 0 idletimeout 120 sizelimit unlimited timelimit 2400 -@@ -28,13 +28,13 @@ - database hdb +@@ -29,7 +29,7 @@ cachesize 300000 - dncachesize 600000 --idlcachesize 900000 -+idlcachesize 900000 dbnosync suffix "o=shadow" --checkpoint 1024 10 -+checkpoint 1024 10 +-checkpoint 1024 0 ++checkpoint 1024 0 rootdn "o=shadow" rootpw secret --directory /var/run/bdii/db -+directory /var/lib/bdii/db - - index GlueCEAccessControlBaseRule eq - index GlueCESEBindCEUniqueID eq -@@ -75,10 +75,10 @@ - idlcachesize 30000 + directory /var/lib/bdii/db/grid +@@ -71,7 +71,7 @@ + cachesize 20000 dbnosync suffix "o=glue" --checkpoint 1024 10 -+checkpoint 1024 10 +-checkpoint 1024 0 ++checkpoint 1024 0 rootdn "o=glue" rootpw secret --directory /var/run/bdii/db/glue2 -+directory /var/lib/bdii/db/glue2 - - index GLUE2GroupID eq - index GLUE2ExtensionLocalID eq -@@ -110,8 +110,8 @@ - idlcachesize 3000 + directory /var/lib/bdii/db/glue +@@ -104,7 +104,7 @@ + cachesize 10 dbnosync suffix "o=infosys" --checkpoint 1024 10 -+checkpoint 1024 10 +-checkpoint 1024 0 ++checkpoint 1024 0 rootdn "o=infosys" rootpw secret --directory /var/run/bdii/db/stats -+directory /var/lib/bdii/db/stats - -diff -ur bdii-5.2.5.orig/etc/init.d/bdii bdii-5.2.5/etc/init.d/bdii ---- bdii-5.2.5.orig/etc/init.d/bdii 2011-09-04 19:37:03.937443775 +0200 -+++ bdii-5.2.5/etc/init.d/bdii 2011-09-04 19:37:16.184289149 +0200 -@@ -37,7 +37,15 @@ + directory /var/lib/bdii/db/stats +diff -ur bdii-5.2.12.orig/etc/init.d/bdii bdii-5.2.12/etc/init.d/bdii +--- bdii-5.2.12.orig/etc/init.d/bdii 2012-08-09 16:49:43.449329015 +0200 ++++ bdii-5.2.12/etc/init.d/bdii 2012-08-09 16:49:25.364120651 +0200 +@@ -4,7 +4,7 @@ + # $Id: bdii,v 1.9 2009/06/18 14:26:52 lfield Exp $ + # chkconfig: - 95 5 + # description: BDII Service +-# config: /opt/bdii/etc/bdii.conf ++# config: /etc/bdii/bdii.conf + + ### BEGIN INIT INFO + # Provides: bdii +@@ -36,7 +36,15 @@ } prog=bdii @@ -159,58 +158,85 @@ diff -ur bdii-5.2.5.orig/etc/init.d/bdii bdii-5.2.5/etc/init.d/bdii RUN=yes -@@ -60,18 +68,18 @@ +@@ -59,9 +67,9 @@ . "${BDII_CONF}" fi -UPDATE_LOCK_FILE=${UPDATE_LOCK_FILE:-/var/lock/subsys/bdii-update} -SLAPD_LOCK_FILE=${SLAPD_LOCK_FILE:-/var/lock/subsys/bdii-slapd} --UPDATE_PID_FILE=${PID_FILE:-/var/run/bdii-update.pid} +-UPDATE_PID_FILE=${PID_FILE:-/var/run/bdii/bdii-update.pid} +UPDATE_LOCK_FILE=${UPDATE_LOCK_FILE:-${LOCK_DIR}/bdii-update} +SLAPD_LOCK_FILE=${SLAPD_LOCK_FILE:-${LOCK_DIR}/bdii-slapd} +UPDATE_PID_FILE=${BDII_PID_FILE:-/var/run/bdii/bdii-update.pid} BDII_USER=${BDII_USER:-ldap} --BDII_VAR_DIR=${BDII_VAR_DIR:-/var/run/bdii} -+BDII_VAR_DIR=${BDII_VAR_DIR:-/var/lib/bdii} + BDII_VAR_DIR=${BDII_VAR_DIR:-/var/lib/bdii} BDII_UPDATE=${BDII_UPDATE:-/usr/sbin/bdii-update} - SLAPD=${SLAPD:-/usr/sbin/slapd} - SLAPD_CONF=${SLAPD_CONF:-/etc/bdii/bdii-slapd.conf} - SLAPD_HOST=${SLAPD_HOST:-0.0.0.0} - SLAPD_PORT=${SLAPD_PORT:-2170} +@@ -72,7 +80,7 @@ + BDII_IPV6_SUPPORT=${BDII_IPV6_SUPPORT:-no} + SLAPD_HOST6=${SLAPD_HOST6:-::} SLAPD_DB_DIR=${SLAPD_DB_DIR:-$BDII_VAR_DIR/db} --SLAPD_PID_FILE=${SLAPD_PID_FILE:-$SLAPD_DB_DIR/slapd.pid} +-SLAPD_PID_FILE=${SLAPD_PID_FILE:-/var/run/bdii/slapd.pid} +SLAPD_PID_FILE=${SLAPD_PID_FILE:-/var/run/bdii/db/slapd.pid} DB_CONFIG=${DB_CONFIG:-/etc/bdii/DB_CONFIG} - if [ -x /sbin/runuser ] ; then -@@ -103,19 +111,20 @@ - #Initialize the database directory. - mkdir -p ${SLAPD_DB_DIR}/stats - mkdir -p ${SLAPD_DB_DIR}/glue2 -+ chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} -+ [ -x /sbin/restorecon ] && /sbin/restorecon -R ${SLAPD_DB_DIR} + +@@ -88,21 +96,6 @@ + RUNUSER=su + fi + +-rundir=/var/run/${prog} +- +-if [ ! -d ${rundir} ]; then +- mkdir -p ${rundir} +-fi +- +-chown ldap:ldap ${rundir} +- +-if [ ! -d ${SLAPD_DB_DIR} ]; then +- mkdir -p ${SLAPD_DB_DIR} +-fi +- +-chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} +-chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} +- + function start(){ + + # Check status +@@ -120,6 +113,7 @@ + + # Create RAM Disk + if [ "${BDII_RAM_DISK}" = "yes" ]; then ++ mkdir -p ${SLAPD_DB_DIR} + mount -t tmpfs -o size=1500M,mode=0744 tmpfs ${SLAPD_DB_DIR} + fi + +@@ -128,18 +122,22 @@ + mkdir -p ${SLAPD_DB_DIR}/glue + mkdir -p ${SLAPD_DB_DIR}/grid mkdir -p ${BDII_VAR_DIR}/archive - mkdir -p /var/lock/subsys + chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} - [ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_DIR} -- chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} + chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} ++ [ -x /sbin/restorecon ] && /sbin/restorecon -R ${SLAPD_DB_DIR} ++ + mkdir -p /var/run/bdii/db + chown -R ${BDII_USER}:${BDII_USER} /var/run/bdii + [ -x /sbin/restorecon ] && /sbin/restorecon -R /var/run/bdii/db ++ $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${SLAPD_DB_DIR}/stats/* 2>/dev/null" - $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${SLAPD_DB_DIR}/glue2/* 2>/dev/null" - $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${SLAPD_DB_DIR}/* 2>/dev/null" + $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${SLAPD_DB_DIR}/glue/* 2>/dev/null" + $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${SLAPD_DB_DIR}/grid/* 2>/dev/null" $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/old.ldif 2>/dev/null" - $RUNUSER -s /bin/sh ${BDII_USER} -c "cp ${DB_CONFIG} ${SLAPD_DB_DIR}" -- $RUNUSER -s /bin/sh ${BDII_USER} -c "cp ${DB_CONFIG} ${SLAPD_DB_DIR}/stats/" -- $RUNUSER -s /bin/sh ${BDII_USER} -c "cp ${DB_CONFIG} ${SLAPD_DB_DIR}/glue2/" -- -+ $RUNUSER -s /bin/sh ${BDII_USER} -c "cp ${DB_CONFIG} ${SLAPD_DB_DIR}/stats" -+ $RUNUSER -s /bin/sh ${BDII_USER} -c "cp ${DB_CONFIG} ${SLAPD_DB_DIR}/glue2" - - echo -n "Starting BDII slapd: " - COMMAND="${SLAPD} -f ${SLAPD_CONF} -h ldap://${SLAPD_HOST}:${SLAPD_PORT} -u ${BDII_USER}" -@@ -148,13 +157,10 @@ +- $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG} ${SLAPD_DB_DIR}/grid/" + $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG} ${SLAPD_DB_DIR}/stats/" + $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG} ${SLAPD_DB_DIR}/glue/" ++ $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG} ${SLAPD_DB_DIR}/grid/" + + if [ ${SLAPD_CONF} = "/etc/bdii/bdii-top-slapd.conf" ] ; then + $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG}_top ${SLAPD_DB_DIR}/grid/DB_CONFIG" +@@ -177,13 +175,10 @@ $RUNUSER -s /bin/sh ${BDII_USER} -c "${BDII_UPDATE} -c ${BDII_CONF} -d" touch ${UPDATE_LOCK_FILE} diff --git a/bdii.spec b/bdii.spec index 3e7b911..e0ae812 100644 --- a/bdii.spec +++ b/bdii.spec @@ -1,17 +1,18 @@ Name: bdii Version: 5.2.12 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Berkeley Database Information Index (BDII) Group: System Environment/Daemons License: ASL 2.0 URL: https://twiki.cern.ch/twiki/bin/view/EGEE/BDII -# The source for this package was pulled from upstream's vcs. Use the -# following commands to generate the tarball: -# svn export http://svnweb.cern.ch/guest/gridinfo/bdii/tags/R_5_2_12 %{name}-%{version} -# tar --gzip -czvf %{name}-%{version}.tar.gz %{name}-%{version} - +# The source for this package was pulled from upstream's vcs. +# Use the following commands to generate the tarball: +# svn export http://svnweb.cern.ch/guest/gridinfo/bdii/tags/R_5_2_12 %{name}-%{version} +# tar -z -c -f %{name}-%{version}.tar.gz %{name}-%{version} Source: %{name}-%{version}.tar.gz +Patch0: %{name}-init.patch +Patch1: %{name}-run-full.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -43,6 +44,8 @@ differences. This is then used to update the database. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build @@ -58,9 +61,9 @@ rm -rf %{buildroot} %pre # Temp fix for upgrade from 5.2.5 to 5.2.7 service %{name} status > /dev/null 2>&1 -if [ $? = 0 ]; then - touch /var/run/bdii/bdii.upgrade - service %{name} stop > /dev/null 2>&1 +if [ $? -eq 0 ]; then + touch %{_localstatedir}/run/%{name}/bdii.upgrade + service %{name} stop > /dev/null 2>&1 fi %post @@ -69,9 +72,9 @@ sed "s/\(rootpw *\)secret/\1$(mkpasswd -s 0 | tr '/' 'x')/" \ %{_sysconfdir}/%{name}/bdii-top-slapd.conf # Temp fix for upgrade from 5.2.5 to 5.2.7 -if [ -f /var/run/bdii/bdii.upgrade ]; then - rm -f /var/run/bdii/bdii.upgrade - service %{name} start > /dev/null 2>&1 +if [ -f %{_localstatedir}/run/%{name}/bdii.upgrade ]; then + rm -f %{_localstatedir}/run/%{name}/bdii.upgrade + service %{name} start > /dev/null 2>&1 fi /sbin/chkconfig --add %{name} @@ -121,6 +124,9 @@ fi %doc copyright %changelog +* Thu Aug 09 2012 Mattias Ellert - 5.2.12-2 +- Rebase and reapply accidentally dropped patches. + * Fri Jul 20 2012 Maria Alandes - 5.2.12-1 - Fixed BDII_IPV6_SUPPORT after testing