[bdii] - New upstream version 5.1.13 - Move restorecon from post sctiptlet to startup script in order to su
Mattias Ellert
ellert at fedoraproject.org
Sun Jan 2 22:25:23 UTC 2011
commit 7f46ae534f44e6984bcccfb8426e209689fedb62
Author: Mattias Ellert <mattias.ellert at fysast.uu.se>
Date: Sun Jan 2 23:24:29 2011 +0100
- New upstream version 5.1.13
- Move restorecon from post sctiptlet to startup script in order to support
/var/run on tmpfs
.gitignore | 2 +-
bdii-context.patch | 11 +++++++
bdii-default.patch | 13 ++++++++
bdii-runuser.patch | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++
bdii-shadowerr.patch | 12 +++++++
bdii-sysconfig.patch | 21 +++++++++++++
bdii.spec | 44 +++++++++++++++++++++------
sources | 2 +-
8 files changed, 173 insertions(+), 12 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 0e04306..2adce00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/bdii-5.1.9.tar.gz
+/bdii-5.1.13.tar.gz
diff --git a/bdii-context.patch b/bdii-context.patch
new file mode 100644
index 0000000..46e9e99
--- /dev/null
+++ b/bdii-context.patch
@@ -0,0 +1,11 @@
+diff -ur bdii-5.1.13.orig/etc/init.d/bdii bdii-5.1.13/etc/init.d/bdii
+--- bdii-5.1.13.orig/etc/init.d/bdii 2011-01-01 09:23:46.978614971 +0100
++++ bdii-5.1.13/etc/init.d/bdii 2011-01-01 11:44:25.771892868 +0100
+@@ -90,6 +90,7 @@
+ 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}
+ $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"
diff --git a/bdii-default.patch b/bdii-default.patch
new file mode 100644
index 0000000..2167ef3
--- /dev/null
+++ b/bdii-default.patch
@@ -0,0 +1,13 @@
+diff -ur bdii-5.1.13.orig/etc/init.d/bdii bdii-5.1.13/etc/init.d/bdii
+--- bdii-5.1.13.orig/etc/init.d/bdii 2011-01-01 09:23:46.000000000 +0100
++++ bdii-5.1.13/etc/init.d/bdii 2011-01-02 01:18:31.000000000 +0100
+@@ -10,7 +10,8 @@
+ # Provides: bdii
+ # Required-Start: $remote_fs $syslog
+ # Required-Stop: $remote_fs $syslog
+-# Default-Stop: 0 1 2 3 4 5 6
++# Default-Start: 2 3 4 5
++# Default-Stop: 0 1 6
+ # Short-Description: BDII
+ # Description: Berkeley Database Information Index
+ ### END INIT INFO
diff --git a/bdii-runuser.patch b/bdii-runuser.patch
new file mode 100644
index 0000000..62835b1
--- /dev/null
+++ b/bdii-runuser.patch
@@ -0,0 +1,80 @@
+diff -ur bdii-5.1.13.orig/etc/init.d/bdii bdii-5.1.13/etc/init.d/bdii
+--- bdii-5.1.13.orig/etc/init.d/bdii 2011-01-01 09:23:46.978614971 +0100
++++ bdii-5.1.13/etc/init.d/bdii 2011-01-01 16:22:50.390658702 +0100
+@@ -61,6 +61,12 @@
+ SLAPD_PID_FILE=${SLAPD_PID_FILE:-$SLAPD_DB_DIR/slapd.pid}
+ DB_CONFIG=${DB_CONFIG:-/etc/bdii/DB_CONFIG}
+
++if [ -x /sbin/runuser ] ; then
++ RUNUSER=runuser
++else
++ RUNUSER=su
++fi
++
+ function start(){
+
+ # Check status
+@@ -91,13 +97,13 @@
+ mkdir -p /var/lock/subsys
+ chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR}
+ chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}
+- 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 ${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 "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 ${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/"
+
+ echo -n "Starting BDII slapd: "
+ COMMAND="${SLAPD} -f ${SLAPD_CONF} -h ldap://$(hostname -f):${SLAPD_PORT} -u ${BDII_USER}"
+@@ -127,7 +133,7 @@
+ fi
+
+ export SLAPD_CONF=${SLAPD_CONF}
+- runuser -s /bin/sh ${BDII_USER} -c "${BDII_UPDATE} -c ${BDII_CONF} -d"
++ $RUNUSER -s /bin/sh ${BDII_USER} -c "${BDII_UPDATE} -c ${BDII_CONF} -d"
+ touch ${UPDATE_LOCK_FILE}
+
+ if [ ! -f ${BDII_VAR_DIR}/bdii-update.pid ]; then
+@@ -179,14 +185,14 @@
+ UPDATE_PID=$(cat ${UPDATE_PID_FILE})
+ fi
+
+- runuser -s /bin/sh ${BDII_USER} -c "kill -15 ${UPDATE_PID} 2>/dev/null"
++ $RUNUSER -s /bin/sh ${BDII_USER} -c "kill -15 ${UPDATE_PID} 2>/dev/null"
+ if [ -n "${UPDATE_PID}" ]; then
+ ps ${UPDATE_PID} >/dev/null 2>&1
+ if [ $? = 0 ]; then
+ sleep 2
+ ps ${UPDATE_PID} >/dev/null 2>&1
+ if [ $? = 0 ]; then
+- runuser -s /bin/sh ${BDII_USER} -c "kill -9 ${UPDATE_PID} 2>/dev/null"
++ $RUNUSER -s /bin/sh ${BDII_USER} -c "kill -9 ${UPDATE_PID} 2>/dev/null"
+ sleep 2
+ ps ${UPDATE_PID} >/dev/null 2>&1
+ if [ $? = 0 ]; then
+@@ -211,14 +217,14 @@
+ SLAPD_PID=$(cat ${SLAPD_PID_FILE})
+ fi
+
+- runuser -s /bin/sh ${BDII_USER} -c "kill -15 ${SLAPD_PID} 2>/dev/null"
++ $RUNUSER -s /bin/sh ${BDII_USER} -c "kill -15 ${SLAPD_PID} 2>/dev/null"
+ if [ -n "${SLAPD_PID}" ]; then
+ ps ${SLAPD_PID} >/dev/null 2>&1
+ if [ $? = 0 ]; then
+ sleep 2
+ ps ${SLAPD_PID} >/dev/null 2>&1
+ if [ $? = 0 ]; then
+- runuser -s /bin/sh ${BDII_USER} -c "kill -9 ${SLAPD_PID} 2>/dev/null"
++ $RUNUSER -s /bin/sh ${BDII_USER} -c "kill -9 ${SLAPD_PID} 2>/dev/null"
+ sleep 2
+ ps ${SLAPD_PID} >/dev/null 2>&1
+ if [ $? = 0 ]; then
diff --git a/bdii-shadowerr.patch b/bdii-shadowerr.patch
new file mode 100644
index 0000000..39a235f
--- /dev/null
+++ b/bdii-shadowerr.patch
@@ -0,0 +1,12 @@
+diff -ur bdii-5.1.13.orig/bin/bdii-update bdii-5.1.13/bin/bdii-update
+--- bdii-5.1.13.orig/bin/bdii-update 2011-01-01 09:23:46.000000000 +0100
++++ bdii-5.1.13/bin/bdii-update 2011-01-02 11:58:38.000000000 +0100
+@@ -291,7 +291,7 @@
+ else:
+ if "o=shadow" in config['BDII_PASSWD'] and root == "o=grid":
+ grouped[root] = [ dn ]
+- else:
++ elif root != "o=shadow":
+ log.error("dn suffix %s in not specified in the slapd configuration file." % (root))
+
+
diff --git a/bdii-sysconfig.patch b/bdii-sysconfig.patch
new file mode 100644
index 0000000..c3338ee
--- /dev/null
+++ b/bdii-sysconfig.patch
@@ -0,0 +1,21 @@
+diff -ur bdii-5.1.13.orig/etc/bdii.conf bdii-5.1.13/etc/bdii.conf
+--- bdii-5.1.13.orig/etc/bdii.conf 2011-01-01 09:23:46.000000000 +0100
++++ bdii-5.1.13/etc/bdii.conf 2011-01-02 11:32:45.000000000 +0100
+@@ -9,4 +9,4 @@
+ BDII_ARCHIVE_SIZE=0
+ BDII_USER=ldap
+ BDII_VAR_DIR=/var/run/bdii
+-FIX_GLUE=yes
+\ No newline at end of file
++FIX_GLUE=yes
+diff -ur bdii-5.1.13.orig/etc/sysconfig/bdii bdii-5.1.13/etc/sysconfig/bdii
+--- bdii-5.1.13.orig/etc/sysconfig/bdii 2011-01-01 09:23:46.000000000 +0100
++++ bdii-5.1.13/etc/sysconfig/bdii 2011-01-02 11:32:01.000000000 +0100
+@@ -1,3 +1,3 @@
+-#SLAPD_CONF=/etc/bdii/bdii-top-slapd.conf
+-#SLAPD=/usr/sbin/slapd2.4
+-#BDII_RAM_DISK=yes
+\ No newline at end of file
++#SLAPD_CONF=/etc/bdii/bdii-slapd.conf
++#SLAPD=/usr/sbin/slapd
++#BDII_RAM_DISK=no
diff --git a/bdii.spec b/bdii.spec
index 05a67ba..ceb8b1e 100644
--- a/bdii.spec
+++ b/bdii.spec
@@ -1,5 +1,5 @@
Name: bdii
-Version: 5.1.9
+Version: 5.1.13
Release: 1%{?dist}
Summary: The Berkeley Database Information Index (BDII)
@@ -7,10 +7,26 @@ Group: System Environment/Daemons
License: ASL 2.0
URL: https://twiki.cern.ch/twiki/bin/view/EGEE/BDII
# The source tarball is created from a svn checkout:
-# svn co http://svnweb.cern.ch/guest/gridinfo/bdii/tags/R_5_1_9 bdii-5.1.9
-# tar -z -c --exclude .svn -f bdii-5.1.9.tar.gz bdii-5.1.9
+# svn co http://svnweb.cern.ch/guest/gridinfo/bdii/tags/R_5_1_13 bdii-5.1.13
+# tar -z -c --exclude .svn -f bdii-5.1.13.tar.gz bdii-5.1.13
Source: %{name}-%{version}.tar.gz
+# Remove lsb dependency
Patch0: %{name}-init.patch
+# Fallback to su when runuser is absent
+# https://gus.fzk.de/ws/ticket_info.php?ticket=65796
+Patch1: %{name}-runuser.patch
+# Restore context on /var/run/bdii
+# https://gus.fzk.de/ws/ticket_info.php?ticket=65794
+Patch2: %{name}-context.patch
+# Make runlevels consistent
+# https://gus.fzk.de/ws/ticket_info.php?ticket=65795
+Patch3: %{name}-default.patch
+# Silence bogus error in logfile
+# https://gus.fzk.de/ws/ticket_info.php?ticket=65797
+Patch4: %{name}-shadowerr.patch
+# Document defaults properly
+# https://gus.fzk.de/ws/ticket_info.php?ticket=65798
+Patch5: %{name}-sysconfig.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -18,15 +34,12 @@ Requires: openldap-clients
Requires: openldap-servers
Requires: glue-schema >= 2.0.0
Requires: globus-proxy-utils
-Requires: sudo
Requires(post): chkconfig
Requires(post): expect
Requires(preun): chkconfig
Requires(preun): initscripts
-Requires(preun): sudo
Requires(postun): initscripts
-Requires(postun): sudo
%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5
Requires(post): policycoreutils
@@ -47,6 +60,11 @@ differences. This is then used to update the database.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
# Fix install paths
sed -e 's!/opt/glite/etc!/var/lib/bdii!g' -e 's!/opt/bdii/etc!/etc/bdii!' \
@@ -76,19 +94,19 @@ else
rm %{buildroot}%{_sysconfdir}/init.d/%{name}
fi
-mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
+chmod 644 %{buildroot}%{_sysconfdir}/sysconfig/%{name}
%clean
rm -rf %{buildroot}
%post
sed "s/\(rootpw *\)secret/\1$(mkpasswd -s 0 | tr '/' 'x')/" \
- -i %{_sysconfdir}/%{name}/bdii-slapd.conf
+ -i %{_sysconfdir}/%{name}/bdii-slapd.conf \
+ %{_sysconfdir}/%{name}/bdii-top-slapd.conf
/sbin/chkconfig --add %{name}
%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5
semanage port -a -t ldap_port_t -p tcp 2170 2>/dev/null || :
semanage fcontext -a -t slapd_db_t "%{_localstatedir}/run/%{name}(/.*)?" 2>/dev/null || :
-restorecon -R %{_localstatedir}/run/%{name} || :
%endif
%preun
@@ -112,12 +130,13 @@ fi
%defattr(-,root,root,-)
%attr(-,ldap,ldap) %{_localstatedir}/lib/%{name}
%attr(-,ldap,ldap) %{_localstatedir}/log/%{name}
-%attr(-,ldap,ldap) %{_localstatedir}/run/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/DB_CONFIG
%config(noreplace) %{_sysconfdir}/%{name}/bdii.conf
%config(noreplace) %{_sysconfdir}/%{name}/BDII.schema
%config(noreplace) %{_sysconfdir}/%{name}/bdii-slapd.conf
+%config(noreplace) %{_sysconfdir}/%{name}/bdii-top-slapd.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/cron.d/bdii-proxy
%{_initrddir}/%{name}
@@ -126,6 +145,11 @@ fi
%doc copyright
%changelog
+* Sat Jan 01 2011 Mattias Ellert <mattias.ellert at fysast.uu.se> - 5.1.13-1
+- New upstream version 5.1.13
+- Move restorecon from post sctiptlet to startup script in order to support
+ /var/run on tmpfs
+
* Thu Sep 23 2010 Mattias Ellert <mattias.ellert at fysast.uu.se> - 5.1.9-1
- New upstream version 5.1.9
diff --git a/sources b/sources
index a344399..e2cde9c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d75d9f31b67ad72e864bad7fa9d80e71 bdii-5.1.9.tar.gz
+b1e90f9d4967f0ce50037f3387bff5cb bdii-5.1.13.tar.gz
More information about the scm-commits
mailing list