diff -Nru bdii-5.2.26/0001-Use-mdb-slapd-backend.patch bdii-6.0.0/0001-Use-mdb-slapd-backend.patch --- bdii-5.2.26/0001-Use-mdb-slapd-backend.patch 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/0001-Use-mdb-slapd-backend.patch 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,85 @@ +From a3312f93c372f9a8dd420fb991d04383531faae6 Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Sun, 4 Dec 2022 08:52:00 +0100 +Subject: [PATCH] Use mdb slapd backend + +The bdb and hdb backends were removed from slapd in openldap 2.5 +--- + etc/bdii-slapd.conf | 9 +++------ + etc/bdii-top-slapd.conf | 9 +++------ + 2 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/etc/bdii-slapd.conf b/etc/bdii-slapd.conf +index 841dbf3..984a111 100644 +--- a/etc/bdii-slapd.conf ++++ b/etc/bdii-slapd.conf +@@ -25,9 +25,8 @@ moduleload back_relay + # GLUE 1.3 database definitions + ####################################################################### + +-database hdb ++database mdb + suffix "o=grid" +-cachesize 30000 + checkpoint 1024 0 + dbnosync + rootdn "o=grid" +@@ -78,9 +77,8 @@ suffixmassage "GLUE2GroupID=resource,GLUE2DomainID=*,GLUE2GroupID=grid,o=glue" + # GLUE 2.0 database definitions + ####################################################################### + +-database hdb ++database mdb + suffix "o=glue" +-cachesize 30000 + checkpoint 1024 0 + dbnosync + rootdn "o=glue" +@@ -114,9 +112,8 @@ index objectClass eq,pres + ####################################################################### + # Stats database definitions + ####################################################################### +-database hdb ++database mdb + suffix "o=infosys" +-cachesize 10 + checkpoint 1024 0 + dbnosync + rootdn "o=infosys" +diff --git a/etc/bdii-top-slapd.conf b/etc/bdii-top-slapd.conf +index c4113bb..df295bd 100644 +--- a/etc/bdii-top-slapd.conf ++++ b/etc/bdii-top-slapd.conf +@@ -26,8 +26,7 @@ moduleload back_relay + # GLUE 1.3 database definitions + ####################################################################### + +-database hdb +-cachesize 300000 ++database mdb + dbnosync + suffix "o=shadow" + checkpoint 1024 0 +@@ -87,8 +86,7 @@ suffixmassage "GLUE2GroupID=resource,GLUE2DomainID=*,GLUE2GroupID=grid,o=glue" + # GLUE 2.0 database definitions + ####################################################################### + +-database hdb +-cachesize 300000 ++database mdb + dbnosync + suffix "o=glue" + checkpoint 1024 0 +@@ -123,8 +121,7 @@ index objectClass eq,pres + ####################################################################### + # Stats database definitions + ####################################################################### +-database hdb +-cachesize 10 ++database mdb + dbnosync + suffix "o=infosys" + checkpoint 1024 0 +-- +2.38.1 + diff -Nru bdii-5.2.26/AUTHORS bdii-6.0.0/AUTHORS --- bdii-5.2.26/AUTHORS 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/AUTHORS 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -Maintainers ------------ -Baptiste Grenier - -Original Authors ----------------- -David Groep - -Contributors ------------- -Maria Alandes Pradillo -Laurence Field -Maarten Litmaath -Felix Ehm -Andrew Elwell -Daniel Johansson -Paolo Andreetto -Petr Vokac https://github.com/vokac -Andrea Manzi -Mattias Ellert -Enol Fernández diff -Nru bdii-5.2.26/AUTHORS.md bdii-6.0.0/AUTHORS.md --- bdii-5.2.26/AUTHORS.md 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/AUTHORS.md 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,22 @@ +# Authors + +## Maintainers + +- Andrea Manzi +- Baptiste Grenier +- Enol Fernandez +- Mattias Ellert + +## Original Authors + +David Groep + +## Contributors + +- Maria Alandes Pradillo +- Maarten Litmaath +- Felix Ehm +- Andrew Elwell +- Daniel Johansson + +[GitHub contributors](https://github.com/EGI-Federation/bdii/graphs/contributors). diff -Nru bdii-5.2.26/bdii.spec bdii-6.0.0/bdii.spec --- bdii-5.2.26/bdii.spec 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/bdii.spec 2022-12-16 14:40:21.000000000 +0000 @@ -1,34 +1,52 @@ -Name: bdii -Version: 5.2.26 -Release: 1%{?dist} -Summary: The Berkeley Database Information Index (BDII) - -Group: System Environment/Daemons -License: ASL 2.0 -URL: https://github.com/EGI-Foundation/bdii - -Source: %{name}-%{version}.tar.gz -BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if %{?fedora}%{!?fedora:0} >= 25 || %{?rhel}%{!?rhel:0} >= 8 +%global use_systemd 1 +%else +%global use_systemd 0 +%endif + +%if %{?fedora}%{!?fedora:0} >= 36 || %{?rhel}%{!?rhel:0} >= 9 +%global use_mdb 1 +%else +%global use_mdb 0 +%endif + +Name: bdii +Version: 6.0.0 +Release: 1%{?dist} +Summary: The Berkeley Database Information Index (BDII) + +License: ASL 2.0 +URL: https://github.com/EGI-Federation/bdii + +Source: %{name}-%{version}.tar.gz +BuildArch: noarch +BuildRequires: make +%if %{use_systemd} +BuildRequires: systemd-rpm-macros +%endif Requires: openldap-clients Requires: openldap-servers Requires: glue-schema >= 2.0.0 -Requires: python +Requires: python3 +Requires: logrotate -Requires(post): chkconfig -Requires(post): expect -Requires(preun): chkconfig -Requires(preun): initscripts -Requires(postun): initscripts - -%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5 -Requires(post): policycoreutils -Requires(postun): policycoreutils -%if %{?fedora}%{!?fedora:0} >= 11 || %{?rhel}%{!?rhel:0} >= 6 -Requires(post): policycoreutils-python -Requires(postun): policycoreutils-python +Requires(post): /usr/bin/mkpasswd +%if %{use_systemd} +%{?systemd_requires} +%else +Requires(post): chkconfig +Requires(preun): chkconfig +Requires(preun): initscripts +Requires(postun): initscripts %endif + +%if %{?fedora}%{!?fedora:0} >= 23 || %{?rhel}%{!?rhel:0} >= 8 +Requires(post): policycoreutils-python-utils +Requires(postun): policycoreutils-python-utils +%else +Requires(post): policycoreutils-python +Requires(postun): policycoreutils-python %endif %description @@ -40,67 +58,75 @@ %prep %setup -q +%if %{use_mdb} +# Use mdb on recent systems +patch -p1 -f < 0001-Use-mdb-slapd-backend.patch +%endif %build %install -rm -rf %{buildroot} make install prefix=%{buildroot} -chmod 644 %{buildroot}%{_sysconfdir}/sysconfig/%{name} +%if %{use_systemd} +rm %{buildroot}%{_initrddir}/%{name} +mkdir -p %{buildroot}%{_unitdir} +install -m 644 -p etc/systemd/bdii.service etc/systemd/bdii-slapd.service %{buildroot}%{_unitdir} +mkdir -p %{buildroot}%{_datadir}/%{name} +install -p etc/systemd/bdii-slapd-start %{buildroot}%{_datadir}/%{name} +%endif -%clean -rm -rf %{buildroot} +rm -rf %{buildroot}%{_docdir}/%{name} +%if %{use_systemd} %pre -# Temp fix for upgrade from 5.2.5 to 5.2.7 -service %{name} status > /dev/null 2>&1 -if [ $? -eq 0 ]; then - touch %{_localstatedir}/run/%{name}/bdii.upgrade - service %{name} stop > /dev/null 2>&1 -fi +# Remove old init config when systemd is used +/sbin/chkconfig --del %{name} >/dev/null 2>&1 || : +%endif %post sed "s/\(rootpw *\)secret/\1$(mkpasswd -s 0 | tr '/' 'x')/" \ -i %{_sysconfdir}/%{name}/bdii-slapd.conf \ %{_sysconfdir}/%{name}/bdii-top-slapd.conf -# Temp fix for upgrade from 5.2.5 to 5.2.7 -if [ -f %{_localstatedir}/run/%{name}/bdii.upgrade ]; then - rm -f %{_localstatedir}/run/%{name}/bdii.upgrade - service %{name} start > /dev/null 2>&1 -fi - +%if %{use_systemd} +%systemd_post %{name}.service +%else /sbin/chkconfig --add %{name} +%endif -%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}/lib/%{name}/db(/.*)?" 2>/dev/null || : semanage fcontext -a -t slapd_var_run_t "%{_localstatedir}/run/%{name}/db(/.*)?" 2>/dev/null || : # Remove selinux labels for old bdii var dir semanage fcontext -d -t slapd_db_t "%{_localstatedir}/run/%{name}(/.*)?" 2>/dev/null || : -%endif %preun +%if %{use_systemd} +%systemd_preun %{name}.service +%else if [ $1 -eq 0 ]; then service %{name} stop > /dev/null 2>&1 /sbin/chkconfig --del %{name} fi +%endif %postun +%if %{use_systemd} +%systemd_postun_with_restart %{name}.service +%else if [ $1 -ge 1 ]; then service %{name} condrestart > /dev/null 2>&1 fi -%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5 +%endif + if [ $1 -eq 0 ]; then semanage port -d -t ldap_port_t -p tcp 2170 2>/dev/null || : semanage fcontext -d -t slapd_db_t "%{_localstatedir}/lib/%{name}/db(/.*)?" 2>/dev/null || : semanage fcontext -d -t slapd_var_run_t "%{_localstatedir}/run/%{name}/db(/.*)?" 2>/dev/null || : fi -%endif %files -%defattr(-,root,root,-) %attr(-,ldap,ldap) %{_localstatedir}/lib/%{name} %attr(-,ldap,ldap) %{_localstatedir}/log/%{name} %dir %{_sysconfdir}/%{name} @@ -112,16 +138,27 @@ %attr(-,ldap,ldap) %config %{_sysconfdir}/%{name}/bdii-top-slapd.conf %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%if %{use_systemd} +%{_unitdir}/bdii.service +%{_unitdir}/bdii-slapd.service +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/bdii-slapd-start +%else %{_initrddir}/%{name} +%endif %{_sbindir}/bdii-update %{_mandir}/man1/bdii-update.1* -%doc /usr/share/doc/bdii/README.md -%doc /usr/share/doc/bdii/AUTHORS -%doc /usr/share/doc/bdii/COPYRIGHT -%doc /usr/share/doc/bdii/LICENSE.txt +%doc AUTHORS.md README.md +%license COPYRIGHT LICENSE.txt %changelog +* Thu Dec 15 2022 Baptiste Grenier - 6.0.0-1 +- Migrate to MDB backend for OpenLDAP 2.5 on recent OS (#42) (Mattias Ellert) +- Fix runtime errors while iterating dictionary in python 3 (#39) (Andrea Manzi) +- Migrate to Python 3 (#25) (Laurence Field, Mattias Ellert) +- Quality control using GitHub actions, update community files (#26) (Baptiste Grenier) + * Wed Sep 23 2020 Baptiste Grenier - 5.2.26-1 - Truncate LDIF password file before updating (Petr Vokac) - Preserve base64 entries (Enol Fernández, Andrea Manzi) @@ -136,7 +173,7 @@ - Update build, documetation and link to new GitHub repository (Baptiste Grenier) * Wed Aug 27 2014 Maria Alandes - 5.2.23-1 -- #GRIDINFO-55: Increase the number of simultaneous threads +- #GRIDINFO-55: Increase the number of simultaneous threads * Mon Sep 9 2013 Maria Alandes - 5.2.22-1 - BUG #102503: Make /var/run/bdii configurable @@ -160,7 +197,7 @@ - BUG #101090: added missing symlink to DB_CONFIG_top for GLUE2 DB backend * Fri May 03 2013 Maria Alandes - 5.2.18-1 -- BUG #101237: bdii-update: GLUE2 entries marked for deletion keep the correct case and can be deleted +- BUG #101237: bdii-update: GLUE2 entries marked for deletion keep the correct case and can be deleted * Tue Jan 15 2013 Maria Alandes - 5.2.17-1 - BUG #99622: Add dependency on openldap2.4-clients in SL5 @@ -171,11 +208,11 @@ * Wed Nov 28 2012 Maria Alandes - 5.2.15-1 - Fixes after testing: Load rwm and back_relay modules in the slapd configuration for site and resource BDII -* Tue Nov 20 2012 Maria Alandes - 5.2.14-1 +* Tue Nov 20 2012 Maria Alandes - 5.2.14-1 - BUG #98931: /sbin/runuser instead of runuser - BUG #98711: Optimise LDAP queries in GLUE 2.0 - BUG #98682: Delete delayed_delete.pkl when BDII is restarted -- BUG #97717: Relay database created to be able to define the GLUE2GroupName and services alias +- BUG #97717: Relay database created to be able to define the GLUE2GroupName and services alias * Wed Aug 15 2012 Laurence Field - 5.2.13-1 - Included Fedora patches upstream: diff -Nru bdii-5.2.26/bin/bdii-update bdii-6.0.0/bin/bdii-update --- bdii-5.2.26/bin/bdii-update 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/bin/bdii-update 2022-12-16 14:40:21.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ############################################################################## # Copyright (c) Members of the EGEE Collaboration. 2004. # See http://www.eu-egee.org/partners/ for details on the copyright @@ -75,7 +75,7 @@ config['BDII_DAEMON'] = False if 'BDII_RUN_DIR' not in config: - config['BDII_RUN_DIR'] = '/var/run/bdii' + config['BDII_RUN_DIR'] = '/run/bdii' if 'BDII_PID_FILE' not in config: config['BDII_PID_FILE'] = "%s/bdii-update.pid" % config['BDII_RUN_DIR'] @@ -153,7 +153,7 @@ pf = os.open(config['BDII_PASSWD_FILE'][rootdn], os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600) - os.write(pf, rootpw) + os.write(pf, rootpw.encode()) os.close(pf) rootdn = False rootpw = False @@ -209,7 +209,7 @@ e = os.open(log_file, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o644) os.dup2(e, 2) os.close(e) - sys.stderr = os.fdopen(2, 'a', 0) + sys.stderr = os.fdopen(2, 'a') # Write PID pid_file = open(config['BDII_PID_FILE'], 'w') @@ -355,7 +355,7 @@ attribute = line[:index].lower() value = line[index + 1:].strip() if value and line[index + 1] == ":": - value = base64.b64decode(line[index + 2:].strip()) + value = base64.b64decode(line[index + 2:].strip()).decode() if attribute in entry: if value not in entry[attribute]: entry[attribute].append(value) @@ -392,7 +392,7 @@ for value in entry[attribute]: if needs_encoding(value): entry_string += "%s:: %s\n" % (attribute, - base64.b64encode(value)) + base64.b64encode(value.encode()).decode()) else: entry_string += "%s: %s\n" % (attribute, value) @@ -517,9 +517,8 @@ entry = convert_entry(ldif[dns[dn][0]:dns[dn][1]]) if dn[:11].lower() == "mds-vo-name": if 'objectclass' in entry: - if 'mds' in map(lambda x: x.lower(), entry['objectclass']): - if 'gluetop' in map(lambda x: x.lower(), - entry['objectclass']): + if 'mds' in [x.lower() for x in entry['objectclass']]: + if 'gluetop' in [x.lower() for x in entry['objectclass']]: value = dn[12:dn.index(",")] entry = {'dn': [dn], 'objectclass': ['MDS'], @@ -669,7 +668,7 @@ log.debug("Finished Diff") log.debug("Sorting Add Keys") - ldif_add.sort(lambda x, y: cmp(len(x), len(y))) + ldif_add.sort(key=lambda x: len(x)) log.debug("Writing ldif_add to disk") if config['BDII_LOG_LEVEL'] == 'DEBUG': @@ -688,7 +687,7 @@ error_file = tempfile.mktemp() roots = group_dns(ldif_add) - suffixes = roots.keys() + suffixes = list(roots.keys()) if "o=shadow" in suffixes: index = suffixes.index("o=shadow") if index > 0: @@ -759,13 +758,13 @@ log.error("Could not modify entries in the database.") modify_error_counter += log_errors(error_file, - ldif_modify_dns.keys()) + list(ldif_modify_dns.keys())) if config['BDII_LOG_LEVEL'] != 'DEBUG': os.remove(error_file) log.debug("Sorting Delete Keys") - ldif_delete.sort(lambda x, y: cmp(len(y), len(x))) + ldif_delete.sort(key=lambda x: len(x)) log.debug("Writing ldif_delete to disk") if config['BDII_LOG_LEVEL'] == 'DEBUG': @@ -802,7 +801,7 @@ delay_delete = {} # Add remove cache timestamps that have been readded - for dn in delay_delete.keys(): + for dn in list(delay_delete.keys()): if dn not in ldif_delete: log.debug("Removing %s from cache (readded)" % dn) delay_delete.pop(dn) @@ -815,7 +814,7 @@ nfh.close() # Remove delayed deletes from LDIF or remove from cache - for dn in delay_delete.keys(): + for dn in list(delay_delete.keys()): if delay_delete[dn] + config[ 'BDII_DELETE_DELAY'] >= delete_timestamp: ldif_delete.remove(dn) @@ -1026,7 +1025,7 @@ os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o644) os.dup2(e, 2) os.close(e) - sys.stderr = os.fdopen(2, 'a', 0) + sys.stderr = os.fdopen(2, 'a') log = get_logger(config['BDII_LOG_FILE'], config['BDII_LOG_LEVEL']) main(config, log) diff -Nru bdii-5.2.26/CHANGELOG bdii-6.0.0/CHANGELOG --- bdii-5.2.26/CHANGELOG 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/CHANGELOG 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [6.0.0] +- Drop debian-specific files and reference official packages (#44) (Baptiste Grenier) +- Migrate to MDB backend for OpenLDAP 2.5 on recent OS (#42) (Mattias Ellert) +- Fix runtime errors while iterating dictionary in python 3 (#39) (Andrea Manzi) +- Migrate to Python 3 (#25) (Laurence Field, Mattias Ellert) +- Quality control using GitHub actions, update community files (#26) (Baptiste Grenier) + +## [5.2.26] +- Truncate LDIF password file before updating (#14) (Petr Vokac) +- Preserve base64 entries (#21) (Enol Fernández, Andrea Manzi) +- Allow BDII_HOSTNAME configuration and default to localhost (#22) (Andrea Manzi) diff -Nru bdii-5.2.26/codemeta.json bdii-6.0.0/codemeta.json --- bdii-5.2.26/codemeta.json 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/codemeta.json 2022-12-16 14:40:21.000000000 +0000 @@ -12,12 +12,45 @@ { "@type": "Person", "@id": "https://orcid.org/0000-0002-5686-3193", - "name": " Baptiste", + "name": "Baptiste", "familyName": "Grenier", "affiliation": { "@type": "Organization", "name": "EGI Foundation", - "url": "http://www.egi.eu" + "url": "https://www.egi.eu" + } + }, + { + "@type": "Person", + "@id": "https://orcid.org/0000-0002-5152-5902", + "name": "Enol", + "familyName": "Fernández", + "affiliation": { + "@type": "Organization", + "name": "EGI Foundation", + "url": "https://www.egi.eu" + } + }, + { + "@type": "Person", + "@id": "https://orcid.org/0000-0001-7949-2199", + "name": "Andrea", + "familyName": "Manzi", + "affiliation": { + "@type": "Organization", + "name": "EGI Foundation", + "url": "https://www.egi.eu" + } + }, + { + "@type": "Person", + "@id": "https://orcid.org/0000-0001-5265-3175", + "name": "Mattias", + "familyName": "Ellert", + "affiliation": { + "@type": "Organization", + "name": "Uppsala Universitet", + "url": "https://www.physics.uu.se" } }, { @@ -27,15 +60,15 @@ } ], "operatingSystem": [ - "LINUX-2.4", - "centos 6", - "centos 7" + "centos 7", + "centos 8", + "centos 9" ], - "installUrl": "https://github.com/EGI-Foundation/glite-info-update-endpoints/releases", + "installUrl": "https://github.com/EGI-Federation/glite-info-update-endpoints/releases", "buildInstructions": "http://gridinfo-documentation.readthedocs.io/", "releaseNotes": "", - "codeRepository": "https://github.com/EGI-Foundation/bdii", - "contIntegration": "https://travis-ci.org/EGI-Foundation/bdii", + "codeRepository": "https://github.com/EGI-Federation/bdii", + "contIntegration": "https://travis-ci.org/EGI-Federation/bdii", "networkStack": "", "supportUnit": { "@type": "contactPoint", diff -Nru bdii-5.2.26/CODEOWNERS bdii-6.0.0/CODEOWNERS --- bdii-5.2.26/CODEOWNERS 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/CODEOWNERS 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,10 @@ +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners +# https://github.blog/2017-07-06-introducing-code-owners/ + +# Assign code owners that will automatically get asked to review Pull Requests +# The last matching pattern takes the most precedence. + +# These owners will be the default owners for everything in the repo. +# Unless a later match takes precedence, they will be requested for +# review when someone opens a pull request. +* @EGI-Federation/bdii diff -Nru bdii-5.2.26/CONTRIBUTING.md bdii-6.0.0/CONTRIBUTING.md --- bdii-5.2.26/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/CONTRIBUTING.md 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,98 @@ +# Contributing + +Thank you for taking the time to contribute to this project. +The maintainers greatly appreciate the interest of contributors and rely on +continued engagement with the community to ensure that this project remains +useful. +We would like to take steps to put contributors in the best possible position +to have their contributions accepted. +Please take a few moments to read this short guide on how to contribute; bear +in mind that contributions regarding how to best contribute are also welcome. + +## Feedback and Questions + +If you wish to discuss anything related to the project, please open an issue or +start a topic on the [EGI Community Forum](https://community.egi.eu). +The maintainers will sometimes move issues off of GitHub to the community forum +if it is thought that longer, more open-ended discussion would be beneficial, +including a wider community scope. + +## Contribution Process + +Before proposing a contribution via pull request, ideally there is an open +issue describing the need for your contribution (refer to this issue number +when you submit the pull request). We have a 3 steps process for contributions. + +1. Fork the project if you have not, and commit changes to a git branch +1. Create a GitHub Pull Request for your change, following the instructions + in the pull request template. +1. Perform a [Code Review](#code-review-process) with the maintainers on the + pull request. + +### Pull Request Requirements + +1. **Explain your contribution in plain language.** To assist the maintainers + in understanding and appreciating your pull request, please use the + template to explain _why_ you are making this contribution, rather than + just _what_ the contribution entails. + +### Code Review Process + +Code review takes place in GitHub pull requests. See [this +article](https://help.github.com/articles/about-pull-requests/) if you're not +familiar with GitHub Pull Requests. + +Once you open a pull request, maintainers will review your code using the +built-in code review process in GitHub PRs. The process at this point is as +follows: + +1. A maintainer will review your code and merge it if no changes are necessary. + Your change will be merged into the repository's `main` branch. +1. If a maintainer has feedback or questions on your changes then they will set + `request changes` in the review and provide an explanation. + +## Using git + +For collaboration purposes, it is best if you create a GitHub account and fork +the repository to your own account. Once you do this you will be able to push +your changes to your GitHub repository for others to see and use, and it will +be easier to send pull requests. + +### Branches and Commits + +You should submit your patch as a git branch named after the GitHub issue, such +as `#3`\. This is called a _topic branch_ and allows users to associate a +branch of code with the issue. + +It is a best practice to have your commit message have a _summary line_ that +includes the issue number, followed by an empty line and then a brief +description of the commit. This also helps other contributors understand the +purpose of changes to the code. + +```text + #3 - platform_family and style + + * use platform_family for platform checking + * update notifies syntax to "resource_type[resource_name]" instead of + resources() lookup + * GH-692 - delete config files dropped off by packages in conf.d + * dropped debian 4 support because all other platforms have the same + values, and it is older than "old stable" debian release +``` + +## Release cycle + +Main branch is always available. +Tagged versions may be created as needed following [Semantic +Versioning](https://semver.org/) as far as applicable. + +## Community + +EGI benefits from a strong community of developers and system administrators, +and vice-versa. If you have any questions or if you would like to get involved +in the wider EGI community you can check out: + +- [EGI Community Forum](https://community.egi.eu/) +- [EGI website](https://www.egi.eu) + +**This file has been modified from the Chef Cookbook Contributing Guide**. diff -Nru bdii-5.2.26/debian/bdii.docs bdii-6.0.0/debian/bdii.docs --- bdii-5.2.26/debian/bdii.docs 2019-04-10 06:11:34.000000000 +0000 +++ bdii-6.0.0/debian/bdii.docs 2022-12-16 17:10:49.000000000 +0000 @@ -1,2 +1,2 @@ -AUTHORS +AUTHORS.md README.md diff -Nru bdii-5.2.26/debian/bdii.service bdii-6.0.0/debian/bdii.service --- bdii-5.2.26/debian/bdii.service 2022-02-07 20:06:58.000000000 +0000 +++ bdii-6.0.0/debian/bdii.service 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -[Unit] -Description=Berkeley Database Information Index -Documentation=man:bdii-update(1) -After=bdii-slapd.service -Requires=bdii-slapd.service -BindsTo=bdii-slapd.service - -[Service] -Type=forking -PIDFile=/run/bdii/bdii-update.pid -EnvironmentFile=-/etc/default/bdii -ExecStart=/bin/sh -c ' \ - BDII_CONF=$${BDII_CONF:-/etc/bdii/bdii.conf} ; \ - [ -r "$${BDII_CONF}" ] && . "$${BDII_CONF}" ; \ - BDII_USER=$${BDII_USER:-ldap} ; \ - BDII_UPDATE=$${BDII_UPDATE:-/usr/sbin/bdii-update} ; \ - export SLAPD_CONF=$${SLAPD_CONF:-/etc/bdii/bdii-slapd.conf} ; \ - /sbin/runuser -s /bin/sh $${BDII_USER} -c "$${BDII_UPDATE} -c $${BDII_CONF} -d ; sleep 2" \ -' - -[Install] -WantedBy=multi-user.target - diff -Nru bdii-5.2.26/debian/bdii-slapd.service bdii-6.0.0/debian/bdii-slapd.service --- bdii-5.2.26/debian/bdii-slapd.service 2022-02-07 20:07:00.000000000 +0000 +++ bdii-6.0.0/debian/bdii-slapd.service 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -[Unit] -Description=Berkeley Database Information Index - slapd -After=network.target network-online.target -PartOf=bdii.service -StopWhenUnneeded=true - -[Service] -Type=forking -EnvironmentFile=-/etc/default/bdii -PIDFile=/run/bdii/db/slapd.pid -ExecStart=/usr/share/bdii/bdii-slapd-start -ExecStopPost=/bin/sh -c "mountpoint -q /var/lib/bdii/db && umount /var/lib/bdii/db || :" diff -Nru bdii-5.2.26/debian/bdii-slapd-start bdii-6.0.0/debian/bdii-slapd-start --- bdii-5.2.26/debian/bdii-slapd-start 2022-02-05 11:09:09.000000000 +0000 +++ bdii-6.0.0/debian/bdii-slapd-start 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -#! /bin/bash - -BDII_CONF=${BDII_CONF:-/etc/bdii/bdii.conf} - -[ -r "${BDII_CONF}" ] && . "${BDII_CONF}" - -BDII_USER=${BDII_USER:-ldap} -BDII_VAR_DIR=${BDII_VAR_DIR:-/var/lib/bdii} -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} -BDII_IPV6_SUPPORT=${BDII_IPV6_SUPPORT:-no} -SLAPD_HOST6=${SLAPD_HOST6:-::} -SLAPD_DB_DIR=${SLAPD_DB_DIR:-$BDII_VAR_DIR/db} -DB_CONFIG=${DB_CONFIG:-/etc/bdii/DB_CONFIG} -DELAYED_DELETE=${DELAYED_DELETE:-${BDII_VAR_DIR}/delayed_delete.pkl} -BDII_RAM_SIZE=${BDII_RAM_SIZE:-1500M} - -if [ "${BDII_IPV6_SUPPORT}" == "yes" ]; then - SLAPD_HOST_STRING="'ldap://${SLAPD_HOST}:${SLAPD_PORT} ldap://[${SLAPD_HOST6}]:${SLAPD_PORT}'" -else - SLAPD_HOST_STRING="ldap://${SLAPD_HOST}:${SLAPD_PORT}" -fi - -if [ -x /sbin/runuser ] ; then - RUNUSER=/sbin/runuser -else - RUNUSER=su -fi - -# Create RAM Disk -if [ "${BDII_RAM_DISK}" = "yes" ]; then - mkdir -p ${SLAPD_DB_DIR} - mount -t tmpfs -o size=${BDII_RAM_SIZE},mode=0744 tmpfs ${SLAPD_DB_DIR} -fi - -# Remove delayed_delete.pkl if it exists -if [ -f "${DELAYED_DELETE}" ] ; then - rm -f ${DELAYED_DELETE} -fi - -#Initialize the database directory. -mkdir -p ${SLAPD_DB_DIR}/stats -mkdir -p ${SLAPD_DB_DIR}/glue -mkdir -p ${SLAPD_DB_DIR}/grid -mkdir -p ${BDII_VAR_DIR}/archive - -chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} -chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} -[ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_DIR} - -mkdir -p /run/bdii/db -chown -R ${BDII_USER}:${BDII_USER} /run/bdii -[ -x /sbin/restorecon ] && /sbin/restorecon -R /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}/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 "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/" - -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" - $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG}_top ${SLAPD_DB_DIR}/stats/DB_CONFIG" - $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG}_top ${SLAPD_DB_DIR}/glue/DB_CONFIG" - $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/top-urls.conf/* 2>/dev/null" - $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/top-urls.conf-glue2/* 2>/dev/null" -else - if [ -r "${BDII_VAR_DIR}/gip/cache" ]; then - $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/site-urls.conf/* 2>/dev/null" - $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/site-urls.conf-glue2/* 2>/dev/null" - fi -fi - -COMMAND="${SLAPD} -f ${SLAPD_CONF} -h ${SLAPD_HOST_STRING} -u ${BDII_USER}" -exec ${COMMAND} - diff -Nru bdii-5.2.26/debian/changelog bdii-6.0.0/debian/changelog --- bdii-5.2.26/debian/changelog 2022-12-04 09:51:44.000000000 +0000 +++ bdii-6.0.0/debian/changelog 2022-12-16 17:10:49.000000000 +0000 @@ -1,3 +1,11 @@ +bdii (6.0.0-1) unstable; urgency=medium + + * Version 6.0.0 + * Drop previously backported patches + * Use systemd unit files from upstream + + -- Mattias Ellert Fri, 16 Dec 2022 18:10:49 +0100 + bdii (5.2.26-3) unstable; urgency=medium * Use mdb slapd backend diff -Nru bdii-5.2.26/debian/copyright bdii-6.0.0/debian/copyright --- bdii-5.2.26/debian/copyright 2022-02-07 20:25:54.000000000 +0000 +++ bdii-6.0.0/debian/copyright 2022-12-16 16:50:37.000000000 +0000 @@ -1,6 +1,6 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: bdii -Source: https://github.com/EGI-Federation/bdii/archive/v5.2.26/bdii-5.2.26.tar.gz +Source: https://github.com/EGI-Federation/bdii/archive/v6.0.0/bdii-6.0.0.tar.gz Files: * Copyright: © 2004, Members of the EGEE Collaboration diff -Nru bdii-5.2.26/debian/patches/bdii-debian.patch bdii-6.0.0/debian/patches/bdii-debian.patch --- bdii-5.2.26/debian/patches/bdii-debian.patch 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/debian/patches/bdii-debian.patch 2022-12-16 17:10:49.000000000 +0000 @@ -0,0 +1,222 @@ +diff -ur bdii-6.0.0.orig/etc/bdii.conf bdii-6.0.0/etc/bdii.conf +--- bdii-6.0.0.orig/etc/bdii.conf 2022-12-16 15:40:21.000000000 +0100 ++++ bdii-6.0.0/etc/bdii.conf 2022-12-16 19:14:23.640000000 +0100 +@@ -9,5 +9,5 @@ + BDII_READ_TIMEOUT=300 + BDII_ARCHIVE_SIZE=0 + BDII_DELETE_DELAY=0 +-BDII_USER=ldap ++BDII_USER=openldap + BDII_VAR_DIR=/var/lib/bdii +diff -ur bdii-6.0.0.orig/etc/bdii-slapd.conf bdii-6.0.0/etc/bdii-slapd.conf +--- bdii-6.0.0.orig/etc/bdii-slapd.conf 2022-12-16 15:40:21.000000000 +0100 ++++ bdii-6.0.0/etc/bdii-slapd.conf 2022-12-16 19:14:23.624000000 +0100 +@@ -1,6 +1,6 @@ +-include /etc/openldap/schema/core.schema +-include /etc/openldap/schema/cosine.schema +-include /etc/openldap/schema/nis.schema ++include /etc/ldap/schema/core.schema ++include /etc/ldap/schema/cosine.schema ++include /etc/ldap/schema/nis.schema + include /etc/bdii/BDII.schema + include /etc/ldap/schema/Glue-CORE.schema + include /etc/ldap/schema/Glue-MDS.schema +@@ -9,6 +9,8 @@ + include /etc/ldap/schema/Glue-SE.schema + include /etc/ldap/schema/GLUE20.schema + ++modulepath /usr/lib/ldap ++moduleload back_mdb + allow bind_v2 + + pidfile /run/bdii/db/slapd.pid +@@ -25,9 +27,8 @@ + # GLUE 1.3 database definitions + ####################################################################### + +-database hdb ++database mdb + suffix "o=grid" +-cachesize 30000 + checkpoint 1024 0 + dbnosync + rootdn "o=grid" +@@ -78,9 +79,8 @@ + # GLUE 2.0 database definitions + ####################################################################### + +-database hdb ++database mdb + suffix "o=glue" +-cachesize 30000 + checkpoint 1024 0 + dbnosync + rootdn "o=glue" +@@ -114,9 +114,8 @@ + ####################################################################### + # Stats database definitions + ####################################################################### +-database hdb ++database mdb + suffix "o=infosys" +-cachesize 10 + checkpoint 1024 0 + dbnosync + rootdn "o=infosys" +diff -ur bdii-6.0.0.orig/etc/bdii-top-slapd.conf bdii-6.0.0/etc/bdii-top-slapd.conf +--- bdii-6.0.0.orig/etc/bdii-top-slapd.conf 2022-12-16 15:40:21.000000000 +0100 ++++ bdii-6.0.0/etc/bdii-top-slapd.conf 2022-12-16 19:14:23.624000000 +0100 +@@ -1,6 +1,6 @@ +-include /etc/openldap/schema/core.schema +-include /etc/openldap/schema/cosine.schema +-include /etc/openldap/schema/nis.schema ++include /etc/ldap/schema/core.schema ++include /etc/ldap/schema/cosine.schema ++include /etc/ldap/schema/nis.schema + include /etc/bdii/BDII.schema + include /etc/ldap/schema/Glue-CORE.schema + include /etc/ldap/schema/Glue-MDS.schema +@@ -9,6 +9,8 @@ + include /etc/ldap/schema/Glue-SE.schema + include /etc/ldap/schema/GLUE20.schema + ++modulepath /usr/lib/ldap ++moduleload back_mdb + allow bind_v2 + + pidfile /run/bdii/db/slapd.pid +@@ -26,8 +28,7 @@ + # GLUE 1.3 database definitions + ####################################################################### + +-database hdb +-cachesize 300000 ++database mdb + dbnosync + suffix "o=shadow" + checkpoint 1024 0 +@@ -87,8 +88,7 @@ + # GLUE 2.0 database definitions + ####################################################################### + +-database hdb +-cachesize 300000 ++database mdb + dbnosync + suffix "o=glue" + checkpoint 1024 0 +@@ -123,8 +123,7 @@ + ####################################################################### + # Stats database definitions + ####################################################################### +-database hdb +-cachesize 10 ++database mdb + dbnosync + suffix "o=infosys" + checkpoint 1024 0 +diff -ur bdii-6.0.0.orig/etc/init.d/bdii bdii-6.0.0/etc/init.d/bdii +--- bdii-6.0.0.orig/etc/init.d/bdii 2022-12-16 15:40:21.000000000 +0100 ++++ bdii-6.0.0/etc/init.d/bdii 2022-12-16 19:14:23.000000000 +0100 +@@ -2,7 +2,7 @@ + # + # BDII system startup script + # $Id: bdii,v 1.9 2009/06/18 14:26:52 lfield Exp $ +-# chkconfig: - 95 5 ++# chkconfig: 2345 95 5 + # description: BDII Service + # config: /etc/bdii/bdii.conf + +@@ -10,31 +10,20 @@ + # 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 + + shopt -s expand_aliases + +-if [ -f /etc/init.d/functions ]; then +- . /etc/init.d/functions ++if [ -f /lib/lsb/init-functions ]; then ++ . /lib/lsb/init-functions + else +- echo "Error: Cannot source /etc/init.d/functions" ++ echo "Error: Cannot source /lib/lsb/init-functions" + fi + +-log_success_msg () +-{ +- success +- echo +-} +- +-log_failure_msg() +-{ +- failure +- echo +-} +- + prog=bdii + + # Debian does not have /run/lock/subsys +@@ -181,21 +170,26 @@ + mkdir -p ${SLAPD_DB_DIR}/grid + mkdir -p ${BDII_VAR_DIR}/archive + +- chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} +- chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} +- [ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_DIR} ++ chown ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} ++ chown ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR}/archive ++ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} ++ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}/stats ++ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}/glue ++ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}/grid ++ [ -x /sbin/restorecon ] && /sbin/restorecon -R ${SLAPD_DB_DIR} + + mkdir -p /run/bdii/db +- chown -R ${BDII_USER}:${BDII_USER} /run/bdii ++ chown ${BDII_USER}:${BDII_USER} /run/bdii ++ chown ${BDII_USER}:${BDII_USER} /run/bdii/db + [ -x /sbin/restorecon ] && /sbin/restorecon -R /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}/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 "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" +diff -ur bdii-6.0.0.orig/etc/systemd/bdii.service bdii-6.0.0/etc/systemd/bdii.service +--- bdii-6.0.0.orig/etc/systemd/bdii.service 2022-12-16 15:40:21.000000000 +0100 ++++ bdii-6.0.0/etc/systemd/bdii.service 2022-12-16 19:14:23.000000000 +0100 +@@ -8,7 +8,7 @@ + [Service] + Type=forking + PIDFile=/run/bdii/bdii-update.pid +-EnvironmentFile=-/etc/sysconfig/bdii ++EnvironmentFile=-/etc/default/bdii + ExecStart=/bin/sh -c ' \ + BDII_CONF=$${BDII_CONF:-/etc/bdii/bdii.conf} ; \ + [ -r "$${BDII_CONF}" ] && . "$${BDII_CONF}" ; \ +diff -ur bdii-6.0.0.orig/etc/systemd/bdii-slapd.service bdii-6.0.0/etc/systemd/bdii-slapd.service +--- bdii-6.0.0.orig/etc/systemd/bdii-slapd.service 2022-12-16 15:40:21.000000000 +0100 ++++ bdii-6.0.0/etc/systemd/bdii-slapd.service 2022-12-16 19:14:23.000000000 +0100 +@@ -6,7 +6,7 @@ + + [Service] + Type=forking +-EnvironmentFile=-/etc/sysconfig/bdii ++EnvironmentFile=-/etc/default/bdii + PIDFile=/run/bdii/db/slapd.pid + ExecStart=/usr/share/bdii/bdii-slapd-start + ExecStopPost=/bin/sh -c "mountpoint -q /var/lib/bdii/db && umount /var/lib/bdii/db || :" diff -Nru bdii-5.2.26/debian/patches/bdii-default.patch bdii-6.0.0/debian/patches/bdii-default.patch --- bdii-5.2.26/debian/patches/bdii-default.patch 2022-02-07 20:11:18.000000000 +0000 +++ bdii-6.0.0/debian/patches/bdii-default.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -diff -ur bdii-5.2.13.orig/etc/init.d/bdii bdii-5.2.13/etc/init.d/bdii ---- bdii-5.2.13.orig/etc/init.d/bdii 2012-08-15 15:08:26.000000000 +0200 -+++ bdii-5.2.13/etc/init.d/bdii 2012-10-24 10:56:38.545657608 +0200 -@@ -2,7 +2,7 @@ - # - # BDII system startup script - # $Id: bdii,v 1.9 2009/06/18 14:26:52 lfield Exp $ --# chkconfig: - 95 5 -+# chkconfig: 2345 95 5 - # description: BDII Service - # config: /etc/bdii/bdii.conf - -@@ -10,31 +10,20 @@ - # 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 - - shopt -s expand_aliases - --if [ -f /etc/init.d/functions ]; then -- . /etc/init.d/functions -+if [ -f /lib/lsb/init-functions ]; then -+ . /lib/lsb/init-functions - else -- echo "Error: Cannot source /etc/init.d/functions" -+ echo "Error: Cannot source /lib/lsb/init-functions" - fi - --log_success_msg () --{ -- success -- echo --} -- --log_failure_msg() --{ -- failure -- echo --} -- - prog=bdii - - # Debian does not have /run/lock/subsys -@@ -123,21 +112,26 @@ - mkdir -p ${SLAPD_DB_DIR}/grid - mkdir -p ${BDII_VAR_DIR}/archive - -- chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} -- chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} -- [ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_DIR} -+ chown ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} -+ chown ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR}/archive -+ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} -+ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}/stats -+ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}/glue -+ chown ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR}/grid -+ [ -x /sbin/restorecon ] && /sbin/restorecon -R ${SLAPD_DB_DIR} - - mkdir -p /run/bdii/db -- chown -R ${BDII_USER}:${BDII_USER} /run/bdii -+ chown ${BDII_USER}:${BDII_USER} /run/bdii -+ chown ${BDII_USER}:${BDII_USER} /run/bdii/db - [ -x /sbin/restorecon ] && /sbin/restorecon -R /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}/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 "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" diff -Nru bdii-5.2.26/debian/patches/bdii-py3.patch bdii-6.0.0/debian/patches/bdii-py3.patch --- bdii-5.2.26/debian/patches/bdii-py3.patch 2022-02-05 11:09:09.000000000 +0000 +++ bdii-6.0.0/debian/patches/bdii-py3.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -diff -ur bdii-5.2.26.orig/bin/bdii-update bdii-5.2.26/bin/bdii-update ---- bdii-5.2.26.orig/bin/bdii-update 2020-09-23 15:57:33.000000000 +0200 -+++ bdii-5.2.26/bin/bdii-update 2022-02-05 11:34:31.246531590 +0100 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/env python3 - ############################################################################## - # Copyright (c) Members of the EGEE Collaboration. 2004. - # See http://www.eu-egee.org/partners/ for details on the copyright -@@ -153,7 +153,7 @@ - pf = os.open(config['BDII_PASSWD_FILE'][rootdn], - os.O_WRONLY | os.O_CREAT | os.O_TRUNC, - 0o600) -- os.write(pf, rootpw) -+ os.write(pf, rootpw.encode()) - os.close(pf) - rootdn = False - rootpw = False -@@ -209,7 +209,7 @@ - e = os.open(log_file, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o644) - os.dup2(e, 2) - os.close(e) -- sys.stderr = os.fdopen(2, 'a', 0) -+ sys.stderr = os.fdopen(2, 'a') - - # Write PID - pid_file = open(config['BDII_PID_FILE'], 'w') -@@ -355,7 +355,7 @@ - attribute = line[:index].lower() - value = line[index + 1:].strip() - if value and line[index + 1] == ":": -- value = base64.b64decode(line[index + 2:].strip()) -+ value = base64.b64decode(line[index + 2:].strip()).decode() - if attribute in entry: - if value not in entry[attribute]: - entry[attribute].append(value) -@@ -392,7 +392,7 @@ - for value in entry[attribute]: - if needs_encoding(value): - entry_string += "%s:: %s\n" % (attribute, -- base64.b64encode(value)) -+ base64.b64encode(value.encode()).decode()) - else: - entry_string += "%s: %s\n" % (attribute, value) - -@@ -517,9 +517,8 @@ - entry = convert_entry(ldif[dns[dn][0]:dns[dn][1]]) - if dn[:11].lower() == "mds-vo-name": - if 'objectclass' in entry: -- if 'mds' in map(lambda x: x.lower(), entry['objectclass']): -- if 'gluetop' in map(lambda x: x.lower(), -- entry['objectclass']): -+ if 'mds' in [x.lower() for x in entry['objectclass']]: -+ if 'gluetop' in [x.lower() for x in entry['objectclass']]: - value = dn[12:dn.index(",")] - entry = {'dn': [dn], - 'objectclass': ['MDS'], -@@ -669,7 +668,7 @@ - log.debug("Finished Diff") - - log.debug("Sorting Add Keys") -- ldif_add.sort(lambda x, y: cmp(len(x), len(y))) -+ ldif_add.sort(key=lambda x: len(x)) - - log.debug("Writing ldif_add to disk") - if config['BDII_LOG_LEVEL'] == 'DEBUG': -@@ -688,7 +687,7 @@ - error_file = tempfile.mktemp() - - roots = group_dns(ldif_add) -- suffixes = roots.keys() -+ suffixes = list(roots.keys()) - if "o=shadow" in suffixes: - index = suffixes.index("o=shadow") - if index > 0: -@@ -759,13 +758,13 @@ - log.error("Could not modify entries in the database.") - - modify_error_counter += log_errors(error_file, -- ldif_modify_dns.keys()) -+ list(ldif_modify_dns.keys())) - - if config['BDII_LOG_LEVEL'] != 'DEBUG': - os.remove(error_file) - - log.debug("Sorting Delete Keys") -- ldif_delete.sort(lambda x, y: cmp(len(y), len(x))) -+ ldif_delete.sort(key=lambda x: len(x)) - - log.debug("Writing ldif_delete to disk") - if config['BDII_LOG_LEVEL'] == 'DEBUG': -@@ -802,7 +801,7 @@ - delay_delete = {} - - # Add remove cache timestamps that have been readded -- for dn in delay_delete.keys(): -+ for dn in list(delay_delete.keys()): - if dn not in ldif_delete: - log.debug("Removing %s from cache (readded)" % dn) - delay_delete.pop(dn) -@@ -815,7 +814,7 @@ - nfh.close() - - # Remove delayed deletes from LDIF or remove from cache -- for dn in delay_delete.keys(): -+ for dn in list(delay_delete.keys()): - if delay_delete[dn] + config[ - 'BDII_DELETE_DELAY'] >= delete_timestamp: - ldif_delete.remove(dn) -@@ -1026,7 +1025,7 @@ - os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o644) - os.dup2(e, 2) - os.close(e) -- sys.stderr = os.fdopen(2, 'a', 0) -+ sys.stderr = os.fdopen(2, 'a') - - log = get_logger(config['BDII_LOG_FILE'], config['BDII_LOG_LEVEL']) - main(config, log) diff -Nru bdii-5.2.26/debian/patches/bdii-update-default-paths.patch bdii-6.0.0/debian/patches/bdii-update-default-paths.patch --- bdii-5.2.26/debian/patches/bdii-update-default-paths.patch 2022-02-05 11:09:09.000000000 +0000 +++ bdii-6.0.0/debian/patches/bdii-update-default-paths.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -From 2480948817911d79f8445308a7995da138849729 Mon Sep 17 00:00:00 2001 -From: Mattias Ellert -Date: Thu, 24 Dec 2020 10:37:36 +0100 -Subject: [PATCH] Update default paths (#31) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use /run instead of /var/run -Use /run/lock instead of /var/lock - -Filesystem Hierarchy Standard 3.0 says about /var/run: -"This directory was once intended for system information data -describing the system since it was booted. These functions have been -moved to /run." - -Using /var/run in systemd unit files results in warnings in the logs: - -$ systemctl status bdii | cat -● bdii.service - Berkeley Database Information Index - Loaded: loaded (/usr/lib/systemd/system/bdii.service; disabled; vendor preset: disabled) - Active: inactive (dead) - Docs: man:bdii-update(1) - -Dec 23 07:15:32 localhost.localdomain systemd[1]: /usr/lib/systemd/system/bdii.service:10: PIDFile= references a path below legacy directory /var/run/, updating /var/run/bdii/bdii-update.pid → /run/bdii/bdii-update.pid; please update the unit file accordingly. ---- - Makefile | 2 +- - bin/bdii-update | 2 +- - etc/bdii-slapd.conf | 4 ++-- - etc/bdii-top-slapd.conf | 4 ++-- - etc/bdii.conf | 2 +- - etc/init.d/bdii | 18 +++++++++--------- - 6 files changed, 16 insertions(+), 16 deletions(-) - -diff --git a/Makefile b/Makefile -index 35acefe..cc379e8 100644 ---- a/Makefile -+++ b/Makefile -@@ -12,7 +12,7 @@ default: - install: - @echo installing ... - @mkdir -p $(prefix)/usr/sbin/ -- @mkdir -p $(prefix)/var/run/bdii/ -+ @mkdir -p $(prefix)/run/bdii/ - @mkdir -p $(prefix)/var/lib/bdii/gip/ldif/ - @mkdir -p $(prefix)/var/lib/bdii/gip/provider/ - @mkdir -p $(prefix)/var/lib/bdii/gip/plugin/ -diff --git a/bin/bdii-update b/bin/bdii-update -index bce8f19..32d9452 100755 ---- a/bin/bdii-update -+++ b/bin/bdii-update -@@ -75,7 +75,7 @@ def get_config(config): - config['BDII_DAEMON'] = False - - if 'BDII_RUN_DIR' not in config: -- config['BDII_RUN_DIR'] = '/var/run/bdii' -+ config['BDII_RUN_DIR'] = '/run/bdii' - - if 'BDII_PID_FILE' not in config: - config['BDII_PID_FILE'] = "%s/bdii-update.pid" % config['BDII_RUN_DIR'] -diff --git a/etc/bdii-slapd.conf b/etc/bdii-slapd.conf -index 115eb67..841dbf3 100644 ---- a/etc/bdii-slapd.conf -+++ b/etc/bdii-slapd.conf -@@ -11,8 +11,8 @@ include /etc/ldap/schema/GLUE20.schema - - allow bind_v2 - --pidfile /var/run/bdii/db/slapd.pid --argsfile /var/run/bdii/db/slapd.args -+pidfile /run/bdii/db/slapd.pid -+argsfile /run/bdii/db/slapd.args - loglevel 0 - idletimeout 120 - sizelimit unlimited -diff --git a/etc/bdii-top-slapd.conf b/etc/bdii-top-slapd.conf -index 9df2958..c4113bb 100644 ---- a/etc/bdii-top-slapd.conf -+++ b/etc/bdii-top-slapd.conf -@@ -11,8 +11,8 @@ include /etc/ldap/schema/GLUE20.schema - - allow bind_v2 - --pidfile /var/run/bdii/db/slapd.pid --argsfile /var/run/bdii/db/slapd.args -+pidfile /run/bdii/db/slapd.pid -+argsfile /run/bdii/db/slapd.args - loglevel 0 - idletimeout 120 - sizelimit unlimited -diff --git a/etc/bdii.conf b/etc/bdii.conf -index 8958346..4986450 100644 ---- a/etc/bdii.conf -+++ b/etc/bdii.conf -@@ -1,5 +1,5 @@ - BDII_LOG_FILE=/var/log/bdii/bdii-update.log --BDII_PID_FILE=/var/run/bdii/bdii-update.pid -+BDII_PID_FILE=/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 -diff --git a/etc/init.d/bdii b/etc/init.d/bdii -index c9f8a01..e81fc13 100755 ---- a/etc/init.d/bdii -+++ b/etc/init.d/bdii -@@ -37,11 +37,11 @@ log_failure_msg() - - prog=bdii - --# Debian does not have /var/lock/subsys --if [ -d /var/lock/subsys ] ; then -- LOCK_DIR=/var/lock/subsys -+# Debian does not have /run/lock/subsys -+if [ -d /run/lock/subsys ] ; then -+ LOCK_DIR=/run/lock/subsys - else -- LOCK_DIR=/var/lock -+ LOCK_DIR=/run/lock - fi - - lockfile=${LOCK_DIR}/$prog # TODO is it necessary?? -@@ -69,7 +69,7 @@ fi - - 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} -+UPDATE_PID_FILE=${BDII_PID_FILE:-/run/bdii/bdii-update.pid} - BDII_USER=${BDII_USER:-ldap} - BDII_VAR_DIR=${BDII_VAR_DIR:-/var/lib/bdii} - BDII_UPDATE=${BDII_UPDATE:-/usr/sbin/bdii-update} -@@ -80,7 +80,7 @@ SLAPD_PORT=${SLAPD_PORT:-2170} - 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:-/var/run/bdii/db/slapd.pid} -+SLAPD_PID_FILE=${SLAPD_PID_FILE:-/run/bdii/db/slapd.pid} - DB_CONFIG=${DB_CONFIG:-/etc/bdii/DB_CONFIG} - DELAYED_DELETE=${DELAYED_DELETE:-${BDII_VAR_DIR}/delayed_delete.pkl} - BDII_RAM_SIZE=${BDII_RAM_SIZE:-1500M} -@@ -185,9 +185,9 @@ function start(){ - chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} - [ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_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 -+ mkdir -p /run/bdii/db -+ chown -R ${BDII_USER}:${BDII_USER} /run/bdii -+ [ -x /sbin/restorecon ] && /sbin/restorecon -R /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}/glue/* 2>/dev/null" --- -2.34.1 - diff -Nru bdii-5.2.26/debian/patches/bdii-use-mdb-slapd-backend.patch bdii-6.0.0/debian/patches/bdii-use-mdb-slapd-backend.patch --- bdii-5.2.26/debian/patches/bdii-use-mdb-slapd-backend.patch 2022-12-04 08:04:44.000000000 +0000 +++ bdii-6.0.0/debian/patches/bdii-use-mdb-slapd-backend.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -From a3312f93c372f9a8dd420fb991d04383531faae6 Mon Sep 17 00:00:00 2001 -From: Mattias Ellert -Date: Sun, 4 Dec 2022 08:52:00 +0100 -Subject: [PATCH] Use mdb slapd backend - -The bdb and hdb backends were removed from slapd in openldap 2.5 ---- - etc/bdii-slapd.conf | 9 +++------ - etc/bdii-top-slapd.conf | 9 +++------ - 2 files changed, 6 insertions(+), 12 deletions(-) - -diff --git a/etc/bdii-slapd.conf b/etc/bdii-slapd.conf -index 841dbf3..984a111 100644 ---- a/etc/bdii-slapd.conf -+++ b/etc/bdii-slapd.conf -@@ -25,9 +25,8 @@ moduleload back_relay - # GLUE 1.3 database definitions - ####################################################################### - --database hdb -+database mdb - suffix "o=grid" --cachesize 30000 - checkpoint 1024 0 - dbnosync - rootdn "o=grid" -@@ -78,9 +77,8 @@ suffixmassage "GLUE2GroupID=resource,GLUE2DomainID=*,GLUE2GroupID=grid,o=glue" - # GLUE 2.0 database definitions - ####################################################################### - --database hdb -+database mdb - suffix "o=glue" --cachesize 30000 - checkpoint 1024 0 - dbnosync - rootdn "o=glue" -@@ -114,9 +112,8 @@ index objectClass eq,pres - ####################################################################### - # Stats database definitions - ####################################################################### --database hdb -+database mdb - suffix "o=infosys" --cachesize 10 - checkpoint 1024 0 - dbnosync - rootdn "o=infosys" -diff --git a/etc/bdii-top-slapd.conf b/etc/bdii-top-slapd.conf -index c4113bb..df295bd 100644 ---- a/etc/bdii-top-slapd.conf -+++ b/etc/bdii-top-slapd.conf -@@ -26,8 +26,7 @@ moduleload back_relay - # GLUE 1.3 database definitions - ####################################################################### - --database hdb --cachesize 300000 -+database mdb - dbnosync - suffix "o=shadow" - checkpoint 1024 0 -@@ -87,8 +86,7 @@ suffixmassage "GLUE2GroupID=resource,GLUE2DomainID=*,GLUE2GroupID=grid,o=glue" - # GLUE 2.0 database definitions - ####################################################################### - --database hdb --cachesize 300000 -+database mdb - dbnosync - suffix "o=glue" - checkpoint 1024 0 -@@ -123,8 +121,7 @@ index objectClass eq,pres - ####################################################################### - # Stats database definitions - ####################################################################### --database hdb --cachesize 10 -+database mdb - dbnosync - suffix "o=infosys" - checkpoint 1024 0 --- -2.38.1 - diff -Nru bdii-5.2.26/debian/patches/series bdii-6.0.0/debian/patches/series --- bdii-5.2.26/debian/patches/series 2022-12-04 09:51:44.000000000 +0000 +++ bdii-6.0.0/debian/patches/series 2022-12-16 17:10:49.000000000 +0000 @@ -1,15 +1,3 @@ -# Python 3 support (from upstream pull requests) -# https://github.com/EGI-Federation/bdii/pull/25 -# https://github.com/EGI-Federation/bdii/pull/39 -bdii-py3.patch - -# Update default paths (/var/run → /run, /var/lock → /run/lock) -# https://github.com/EGI-Federation/bdii/pull/31 -bdii-update-default-paths.patch - -# Use debian defaults in the init script -bdii-default.patch - -# Use mdb slapd backend -# https://github.com/EGI-Federation/bdii/pull/42 -bdii-use-mdb-slapd-backend.patch +# Adapt to debian +# This includes the changes in ../0001-Use-mdb-slapd-backend.patch +bdii-debian.patch diff -Nru bdii-5.2.26/debian/rules bdii-6.0.0/debian/rules --- bdii-5.2.26/debian/rules 2022-12-04 09:51:44.000000000 +0000 +++ bdii-6.0.0/debian/rules 2022-12-16 17:10:49.000000000 +0000 @@ -1,12 +1,13 @@ #!/usr/bin/make -f - %: dh $@ --with python3 override_dh_auto_clean: rm -f debian/bdii.init rm -f debian/bdii.default + rm -f debian/bdii.service + rm -f debian/bdii-slapd.service override_dh_auto_build: @@ -15,16 +16,7 @@ mv debian/bdii/etc/init.d/bdii debian/bdii.init mv debian/bdii/etc/sysconfig/bdii debian/bdii.default - slapd_modulepath="modulepath /usr/lib/ldap" ; \ - slapd_moduleload="moduleload back_mdb" ; \ - sed -e "/allow bind_v2/i$${slapd_modulepath}\n$${slapd_moduleload}" \ - -e "s!etc/openldap/schema!etc/ldap/schema!" \ - -i debian/bdii/etc/bdii/bdii-slapd.conf \ - debian/bdii/etc/bdii/bdii-top-slapd.conf - - sed "s/BDII_USER=.*/BDII_USER=openldap/" \ - -i debian/bdii/etc/bdii/bdii.conf - + rmdir debian/bdii/etc/sysconfig rmdir debian/bdii/run/bdii rmdir debian/bdii/run @@ -41,7 +33,9 @@ ln -s /usr/share/bdii/default.ldif debian/bdii/var/lib/bdii/gip/ldif # Wrapper script for systemd - install -m 755 debian/bdii-slapd-start debian/bdii/usr/share/bdii + install -m 755 etc/systemd/bdii-slapd-start debian/bdii/usr/share/bdii + install -m 644 etc/systemd/bdii.service debian + install -m 644 etc/systemd/bdii-slapd.service debian override_dh_installinit: dh_installinit --no-enable diff -Nru bdii-5.2.26/etc/bdii.conf bdii-6.0.0/etc/bdii.conf --- bdii-5.2.26/etc/bdii.conf 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/etc/bdii.conf 2022-12-16 14:40:21.000000000 +0000 @@ -1,5 +1,5 @@ BDII_LOG_FILE=/var/log/bdii/bdii-update.log -BDII_PID_FILE=/var/run/bdii/bdii-update.pid +BDII_PID_FILE=/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 diff -Nru bdii-5.2.26/etc/bdii-slapd.conf bdii-6.0.0/etc/bdii-slapd.conf --- bdii-5.2.26/etc/bdii-slapd.conf 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/etc/bdii-slapd.conf 2022-12-16 14:40:21.000000000 +0000 @@ -11,8 +11,8 @@ allow bind_v2 -pidfile /var/run/bdii/db/slapd.pid -argsfile /var/run/bdii/db/slapd.args +pidfile /run/bdii/db/slapd.pid +argsfile /run/bdii/db/slapd.args loglevel 0 idletimeout 120 sizelimit unlimited diff -Nru bdii-5.2.26/etc/bdii-top-slapd.conf bdii-6.0.0/etc/bdii-top-slapd.conf --- bdii-5.2.26/etc/bdii-top-slapd.conf 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/etc/bdii-top-slapd.conf 2022-12-16 14:40:21.000000000 +0000 @@ -11,8 +11,8 @@ allow bind_v2 -pidfile /var/run/bdii/db/slapd.pid -argsfile /var/run/bdii/db/slapd.args +pidfile /run/bdii/db/slapd.pid +argsfile /run/bdii/db/slapd.args loglevel 0 idletimeout 120 sizelimit unlimited diff -Nru bdii-5.2.26/etc/init.d/bdii bdii-6.0.0/etc/init.d/bdii --- bdii-5.2.26/etc/init.d/bdii 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/etc/init.d/bdii 2022-12-16 14:40:21.000000000 +0000 @@ -37,11 +37,11 @@ prog=bdii -# Debian does not have /var/lock/subsys -if [ -d /var/lock/subsys ] ; then - LOCK_DIR=/var/lock/subsys +# Debian does not have /run/lock/subsys +if [ -d /run/lock/subsys ] ; then + LOCK_DIR=/run/lock/subsys else - LOCK_DIR=/var/lock + LOCK_DIR=/run/lock fi lockfile=${LOCK_DIR}/$prog # TODO is it necessary?? @@ -69,7 +69,7 @@ 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} +UPDATE_PID_FILE=${BDII_PID_FILE:-/run/bdii/bdii-update.pid} BDII_USER=${BDII_USER:-ldap} BDII_VAR_DIR=${BDII_VAR_DIR:-/var/lib/bdii} BDII_UPDATE=${BDII_UPDATE:-/usr/sbin/bdii-update} @@ -80,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:-/var/run/bdii/db/slapd.pid} +SLAPD_PID_FILE=${SLAPD_PID_FILE:-/run/bdii/db/slapd.pid} DB_CONFIG=${DB_CONFIG:-/etc/bdii/DB_CONFIG} DELAYED_DELETE=${DELAYED_DELETE:-${BDII_VAR_DIR}/delayed_delete.pkl} BDII_RAM_SIZE=${BDII_RAM_SIZE:-1500M} @@ -185,9 +185,9 @@ chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} [ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_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 + mkdir -p /run/bdii/db + chown -R ${BDII_USER}:${BDII_USER} /run/bdii + [ -x /sbin/restorecon ] && /sbin/restorecon -R /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}/glue/* 2>/dev/null" diff -Nru bdii-5.2.26/etc/systemd/bdii.service bdii-6.0.0/etc/systemd/bdii.service --- bdii-5.2.26/etc/systemd/bdii.service 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/etc/systemd/bdii.service 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,23 @@ +[Unit] +Description=Berkeley Database Information Index +Documentation=man:bdii-update(1) +After=bdii-slapd.service +Requires=bdii-slapd.service +BindsTo=bdii-slapd.service + +[Service] +Type=forking +PIDFile=/run/bdii/bdii-update.pid +EnvironmentFile=-/etc/sysconfig/bdii +ExecStart=/bin/sh -c ' \ + BDII_CONF=$${BDII_CONF:-/etc/bdii/bdii.conf} ; \ + [ -r "$${BDII_CONF}" ] && . "$${BDII_CONF}" ; \ + BDII_USER=$${BDII_USER:-ldap} ; \ + BDII_UPDATE=$${BDII_UPDATE:-/usr/sbin/bdii-update} ; \ + export SLAPD_CONF=$${SLAPD_CONF:-/etc/bdii/bdii-slapd.conf} ; \ + /sbin/runuser -s /bin/sh $${BDII_USER} -c "$${BDII_UPDATE} -c $${BDII_CONF} -d ; sleep 2" \ +' + +[Install] +WantedBy=multi-user.target + diff -Nru bdii-5.2.26/etc/systemd/bdii-slapd.service bdii-6.0.0/etc/systemd/bdii-slapd.service --- bdii-5.2.26/etc/systemd/bdii-slapd.service 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/etc/systemd/bdii-slapd.service 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,12 @@ +[Unit] +Description=Berkeley Database Information Index - slapd +After=network.target network-online.target +PartOf=bdii.service +StopWhenUnneeded=true + +[Service] +Type=forking +EnvironmentFile=-/etc/sysconfig/bdii +PIDFile=/run/bdii/db/slapd.pid +ExecStart=/usr/share/bdii/bdii-slapd-start +ExecStopPost=/bin/sh -c "mountpoint -q /var/lib/bdii/db && umount /var/lib/bdii/db || :" diff -Nru bdii-5.2.26/etc/systemd/bdii-slapd-start bdii-6.0.0/etc/systemd/bdii-slapd-start --- bdii-5.2.26/etc/systemd/bdii-slapd-start 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/etc/systemd/bdii-slapd-start 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,80 @@ +#! /bin/bash + +BDII_CONF=${BDII_CONF:-/etc/bdii/bdii.conf} + +[ -r "${BDII_CONF}" ] && . "${BDII_CONF}" + +BDII_USER=${BDII_USER:-ldap} +BDII_VAR_DIR=${BDII_VAR_DIR:-/var/lib/bdii} +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} +BDII_IPV6_SUPPORT=${BDII_IPV6_SUPPORT:-no} +SLAPD_HOST6=${SLAPD_HOST6:-::} +SLAPD_DB_DIR=${SLAPD_DB_DIR:-$BDII_VAR_DIR/db} +DB_CONFIG=${DB_CONFIG:-/etc/bdii/DB_CONFIG} +DELAYED_DELETE=${DELAYED_DELETE:-${BDII_VAR_DIR}/delayed_delete.pkl} +BDII_RAM_SIZE=${BDII_RAM_SIZE:-1500M} + +if [ "${BDII_IPV6_SUPPORT}" == "yes" ]; then + SLAPD_HOST_STRING="'ldap://${SLAPD_HOST}:${SLAPD_PORT} ldap://[${SLAPD_HOST6}]:${SLAPD_PORT}'" +else + SLAPD_HOST_STRING="ldap://${SLAPD_HOST}:${SLAPD_PORT}" +fi + +if [ -x /sbin/runuser ] ; then + RUNUSER=/sbin/runuser +else + RUNUSER=su +fi + +# Create RAM Disk +if [ "${BDII_RAM_DISK}" = "yes" ]; then + mkdir -p ${SLAPD_DB_DIR} + mount -t tmpfs -o size=${BDII_RAM_SIZE},mode=0744 tmpfs ${SLAPD_DB_DIR} +fi + +# Remove delayed_delete.pkl if it exists +if [ -f "${DELAYED_DELETE}" ] ; then + rm -f ${DELAYED_DELETE} +fi + +#Initialize the database directory. +mkdir -p ${SLAPD_DB_DIR}/stats +mkdir -p ${SLAPD_DB_DIR}/glue +mkdir -p ${SLAPD_DB_DIR}/grid +mkdir -p ${BDII_VAR_DIR}/archive + +chown -R ${BDII_USER}:${BDII_USER} ${BDII_VAR_DIR} +chown -R ${BDII_USER}:${BDII_USER} ${SLAPD_DB_DIR} +[ -x /sbin/restorecon ] && /sbin/restorecon -R ${BDII_VAR_DIR} + +mkdir -p /run/bdii/db +chown -R ${BDII_USER}:${BDII_USER} /run/bdii +[ -x /sbin/restorecon ] && /sbin/restorecon -R /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}/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 "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/" + +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" + $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG}_top ${SLAPD_DB_DIR}/stats/DB_CONFIG" + $RUNUSER -s /bin/sh ${BDII_USER} -c "ln -sf ${DB_CONFIG}_top ${SLAPD_DB_DIR}/glue/DB_CONFIG" + $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/top-urls.conf/* 2>/dev/null" + $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/top-urls.conf-glue2/* 2>/dev/null" +else + if [ -r "${BDII_VAR_DIR}/gip/cache" ]; then + $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/site-urls.conf/* 2>/dev/null" + $RUNUSER -s /bin/sh ${BDII_USER} -c "rm -f ${BDII_VAR_DIR}/gip/cache/gip/site-urls.conf-glue2/* 2>/dev/null" + fi +fi + +COMMAND="${SLAPD} -f ${SLAPD_CONF} -h ${SLAPD_HOST_STRING} -u ${BDII_USER}" +exec ${COMMAND} + diff -Nru bdii-5.2.26/.github/CODE_OF_CONDUCT.md bdii-6.0.0/.github/CODE_OF_CONDUCT.md --- bdii-5.2.26/.github/CODE_OF_CONDUCT.md 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/CODE_OF_CONDUCT.md 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,95 @@ +# Code of Conduct + +This code of conduct applies to the maintainers and contributors alike. + +## Dealing with issues and support requests + +_We wish to add a specific section on dealing with issues opened against the +repository here._ + +This repository exists in the context of the EGI Federation. While that scope +does not restrict the usage, it does inform the priority we assign to issues and +the order we deal with them. + +We welcome issues reported by the public, and more specifically the community of +people using this repository. + +The EGI team is small and cannot support all requests equally. + +While we undertake to do everything in our power to respond to issues in a +timely manner, and to prioritise issues based on reasonable requests from +submitters, the maintainers expect that the prioritisation of issues as decided +by them is respected. + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, nationality, personal appearance, race, religion, or sexual identity +and orientation. + +## Our Standards + +Examples of behaviour that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behaviour by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behaviour and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behaviour. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviours that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behaviour may be +reported by contacting the EGI Foundation team at contact@egi.eu. The team will +review and investigate all complaints, and will respond in a way that it deems +appropriate to the circumstances. The team is obligated to maintain +confidentiality with regard to the reporter of an incident. Further details of +specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff -Nru bdii-5.2.26/.github/dependabot.yml bdii-6.0.0/.github/dependabot.yml --- bdii-5.2.26/.github/dependabot.yml 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/dependabot.yml 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,8 @@ +--- +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff -Nru bdii-5.2.26/.github/ISSUE_TEMPLATE.md bdii-6.0.0/.github/ISSUE_TEMPLATE.md --- bdii-5.2.26/.github/ISSUE_TEMPLATE.md 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/ISSUE_TEMPLATE.md 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,52 @@ + + +# Short Description of the issue + + + +## Environment + + + +- Operating System: +- Other related components versions: + +## Steps to reproduce + + + +## Logs, stacktrace, or other symptoms + + + +```shell +output +``` + + + +# Summary of proposed changes diff -Nru bdii-5.2.26/.github/linters/.flake8 bdii-6.0.0/.github/linters/.flake8 --- bdii-5.2.26/.github/linters/.flake8 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/linters/.flake8 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,4 @@ +[flake8] +# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8 +extend-ignore = E203,W503 +max-line-length = 88 diff -Nru bdii-5.2.26/.github/linters/.markdownlint.json bdii-6.0.0/.github/linters/.markdownlint.json --- bdii-5.2.26/.github/linters/.markdownlint.json 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/linters/.markdownlint.json 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,12 @@ +{ + "MD013": { + "line_length": 120, + "code_blocks": false, + "tables": false + }, + "MD014": false, + "MD024": false, + "MD026": { + "punctuation": ".,:;!" + } +} diff -Nru bdii-5.2.26/.github/linters/mlc_config.json bdii-6.0.0/.github/linters/mlc_config.json --- bdii-5.2.26/.github/linters/mlc_config.json 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/linters/mlc_config.json 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,10 @@ +{ + "ignorePatterns": [ + { + "pattern": "^http://localhost" + }, + { + "pattern": "^https://example.com" + } + ] +} diff -Nru bdii-5.2.26/.github/PULL_REQUEST_TEMPLATE.md bdii-6.0.0/.github/PULL_REQUEST_TEMPLATE.md --- bdii-5.2.26/.github/PULL_REQUEST_TEMPLATE.md 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/PULL_REQUEST_TEMPLATE.md 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,17 @@ + + +# Summary + + + +--- + + + +**Related issue :** diff -Nru bdii-5.2.26/.github/workflows/build.yml bdii-6.0.0/.github/workflows/build.yml --- bdii-5.2.26/.github/workflows/build.yml 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/workflows/build.yml 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,119 @@ +--- +name: Create packages and test installation + +on: + pull_request: + +jobs: + centos7: + name: Build CentOS 7 RPMs + runs-on: ubuntu-latest + container: quay.io/centos/centos:7 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install build requisites + run: | + yum install -y rpm-build rpmlint make rsync + - name: build rpm + run: | + make clean rpm + rpmlint --file .rpmlint.ini build/RPMS/noarch/*.rpm + - name: Upload RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms7 + path: | + build/RPMS/noarch/bdii-*-1.el7.noarch.rpm + + centos8: + name: Build CentOS Stream 8 RPMs + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream8 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install build requisites + run: | + yum install -y rpm-build rpmlint make rsync + - name: build rpm + run: | + make clean rpm + rpmlint --file .rpmlint.ini build/RPMS/noarch/*.rpm + - name: Upload RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms8 + path: | + build/RPMS/noarch/bdii-*-1.el8.noarch.rpm + + centos9: + name: Build CentOS Stream 9 RPMs + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream9 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install build requisites + run: | + yum install -y rpm-build rpmlint make rsync systemd-rpm-macros + - name: build rpm + run: | + make clean rpm + rpmlint --file .rpmlint.ini build/RPMS/noarch/*.rpm + - name: Upload RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms9 + path: | + build/RPMS/noarch/bdii-*-1.el9.noarch.rpm + + # XXX Dependency from EPEL: glue-schema + centos7-install: + name: Install CentOS 7 RPMs + needs: centos7 + runs-on: ubuntu-latest + container: quay.io/centos/centos:7 + steps: + - uses: actions/download-artifact@v3 + with: + name: rpms7 + - name: Install generated RPMs + run: | + yum install -y epel-release + yum localinstall -y bdii-*.el7.noarch.rpm + + # XXX Dependency from EPEL: glue-schema + # Dependency from PowerTools: openldap-servers + centos8-install: + name: Install CentOS Stream 8 RPMs + needs: centos8 + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream8 + steps: + - uses: actions/download-artifact@v3 + with: + name: rpms8 + - name: Install generated RPMs + run: | + yum install -y epel-release + sed -i 's/^enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-Stream-PowerTools.repo + yum localinstall -y bdii-*.el8.noarch.rpm + + # XXX Dependencies from EPEL: glue-schema, openldap-servers + centos9-install: + name: Install CentOS Stream 9 RPMs + needs: centos9 + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream9 + steps: + - uses: actions/download-artifact@v3 + with: + name: rpms9 + - name: Install generated RPMs + run: | + yum install -y epel-release + yum localinstall -y bdii-*.el9.noarch.rpm diff -Nru bdii-5.2.26/.github/workflows/check-links.yml bdii-6.0.0/.github/workflows/check-links.yml --- bdii-5.2.26/.github/workflows/check-links.yml 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/workflows/check-links.yml 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,29 @@ +--- +name: Check links + +on: + pull_request: + +jobs: + markdown-link-check: + name: Check links using markdown-link-check + runs-on: ubuntu-latest + + steps: + # Checks out a copy of your repository on the ubuntu-latest machine + - name: Checkout code + uses: actions/checkout@v3 + with: + # Make sure the actual branch is checked out when running on PR + ref: ${{ github.event.pull_request.head.sha }} + # Full git history needed to get proper list of changed files + fetch-depth: 0 + + - name: Check links on new changes + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + config-file: ".github/linters/mlc_config.json" + check-modified-files-only: "yes" + use-quiet-mode: "yes" + use-verbose-mode: "yes" + base-branch: "main" diff -Nru bdii-5.2.26/.github/workflows/lint.yml bdii-6.0.0/.github/workflows/lint.yml --- bdii-5.2.26/.github/workflows/lint.yml 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/workflows/lint.yml 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,35 @@ +--- +name: Lint + +on: + pull_request: + +jobs: + super-lint: + name: Lint with Supper-Linter + runs-on: ubuntu-latest + + steps: + # Checks out a copy of your repository on the ubuntu-latest machine + - name: Checkout code + uses: actions/checkout@v3 + with: + # Make sure the actual branch is checked out when running on PR + ref: ${{ github.event.pull_request.head.sha }} + # Full git history needed to get proper list of changed files + fetch-depth: 0 + + # Runs the Super-Linter action + - name: Run Super-Linter on new changes + uses: docker://ghcr.io/github/super-linter:slim-v4 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MARKDOWN_CONFIG_FILE: .markdownlint.json + # Only check new or edited files + VALIDATE_ALL_CODEBASE: false + # Fail on errors + DISABLE_ERRORS: false + # shellcheck conf + SHELLCHECK_OPTS: + -e SC1090,SC2046,SC2164,SC2166,SC1091,SC2086,SC2001,SC2219,SC2181 diff -Nru bdii-5.2.26/.github/workflows/release.yml bdii-6.0.0/.github/workflows/release.yml --- bdii-5.2.26/.github/workflows/release.yml 1970-01-01 00:00:00.000000000 +0000 +++ bdii-6.0.0/.github/workflows/release.yml 2022-12-16 14:40:21.000000000 +0000 @@ -0,0 +1,152 @@ +--- +# When a tag is created +# - create a new release from the tag +# - build and attach packages to the release +name: Create packages and release + +on: + push: + tags: + - "v*" + +jobs: + centos7: + name: Build centOS 7 RPMs + runs-on: ubuntu-latest + container: quay.io/centos/centos:7 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: install build requisites + run: | + yum install -y rpm-build make rsync + - name: build rpm + run: | + make clean rpm + - name: Upload RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms7 + path: | + build/RPMS/noarch/bdii-*-1.el7.noarch.rpm + build/SRPMS/bdii-*-1.el7.src.rpm + + centos8: + name: Build CentOS Stream 8 RPMs + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream8 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install build requisites + run: | + yum install -y rpm-build make rsync + - name: build rpm + run: | + make clean rpm + - name: Upload RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms8 + path: | + build/RPMS/noarch/bdii-*-1.el8.noarch.rpm + build/SRPMS/bdii-*-1.el8.src.rpm + + centos9: + name: Build CentOS Stream 9 RPMs + runs-on: ubuntu-latest + container: quay.io/centos/centos:stream9 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install build requisites + run: | + yum install -y rpm-build make rsync systemd-rpm-macros + - name: build rpm + run: | + make clean rpm + - name: Upload RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms9 + path: | + build/RPMS/noarch/bdii-*-1.el9.noarch.rpm + build/SRPMS/bdii-*-1.el9.src.rpm + + release7: + name: Upload CentOS 7 release artefacts + needs: centos7 + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: rpms7 + - name: Find package name + id: package_name_centos7 + run: | + rpm_path=$(find . -name 'bdii-*-1.el7.noarch.rpm') + src_path=$(find . -name 'bdii-*-1.el7.src.rpm') + echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT" + echo "src_path=${src_path}" >> "$GITHUB_OUTPUT" + - name: Attach CentOS 7 RPMs to the release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + fail_on_unmatched_files: true + files: | + ${{ steps.package_name_centos7.outputs.rpm_path }} + ${{ steps.package_name_centos7.outputs.src_path }} + + release8: + name: Upload CentOS Stream 8 release artefacts + needs: centos8 + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: rpms8 + - name: Find package name + id: package_name_centos8 + run: | + rpm_path=$(find . -name 'bdii-*-1.el8.noarch.rpm') + src_path=$(find . -name 'bdii-*-1.el8.src.rpm') + echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT" + echo "src_path=${src_path}" >> "$GITHUB_OUTPUT" + - name: Attach CentOS Stream 8 RPMs to the release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + fail_on_unmatched_files: true + files: | + ${{ steps.package_name_centos8.outputs.rpm_path }} + ${{ steps.package_name_centos8.outputs.src_path }} + + release9: + name: Upload CentOS Stream 9 release artefacts + needs: centos9 + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: rpms9 + - name: Find package name + id: package_name_centos9 + run: | + rpm_path=$(find . -name 'bdii-*-1.el9.noarch.rpm') + src_path=$(find . -name 'bdii-*-1.el9.src.rpm') + echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT" + echo "src_path=${src_path}" >> "$GITHUB_OUTPUT" + - name: Attach CentOS Stream 9 RPMs to the release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + fail_on_unmatched_files: true + files: | + ${{ steps.package_name_centos9.outputs.rpm_path }} + ${{ steps.package_name_centos9.outputs.src_path }} diff -Nru bdii-5.2.26/Makefile bdii-6.0.0/Makefile --- bdii-5.2.26/Makefile 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/Makefile 2022-12-16 14:40:21.000000000 +0000 @@ -1,6 +1,6 @@ -NAME= $(shell grep Name: *.spec | sed 's/^[^:]*:[^a-zA-Z]*//' ) -VERSION= $(shell grep Version: *.spec | sed 's/^[^:]*:[^0-9]*//' ) -RELEASE= $(shell grep Release: *.spec |cut -d"%" -f1 |sed 's/^[^:]*:[^0-9]*//') +NAME=$(shell grep Name: *.spec | sed 's/^[^:]*:[^a-zA-Z]*//') +VERSION=$(shell grep Version: *.spec | sed 's/^[^:]*:[^0-9]*//') +RELEASE=$(shell grep Release: *.spec | cut -d"%" -f1 | sed 's/^[^:]*:[^0-9]*//') build=$(shell pwd)/build DATE=$(shell date "+%a, %d %b %Y %T %z") dist=$(shell rpm --eval '%dist' | sed 's/%dist/.el5/') @@ -12,7 +12,7 @@ install: @echo installing ... @mkdir -p $(prefix)/usr/sbin/ - @mkdir -p $(prefix)/var/run/bdii/ + @mkdir -p $(prefix)/run/bdii/ @mkdir -p $(prefix)/var/lib/bdii/gip/ldif/ @mkdir -p $(prefix)/var/lib/bdii/gip/provider/ @mkdir -p $(prefix)/var/lib/bdii/gip/plugin/ @@ -24,20 +24,20 @@ @mkdir -p $(prefix)/usr/share/doc/bdii/ @mkdir -p $(prefix)/usr/share/man/man1 - @install -m 0755 etc/init.d/bdii $(prefix)/${init_dir}/ - @install -m 0644 etc/sysconfig/bdii $(prefix)/etc/sysconfig/ - @install -m 0755 bin/bdii-update $(prefix)/usr/sbin/ - @install -m 0644 etc/bdii.conf $(prefix)/etc/bdii/ - @install -m 0644 etc/BDII.schema $(prefix)/etc/bdii/ - @install -m 0640 etc/bdii-slapd.conf $(prefix)/etc/bdii/ - @install -m 0640 etc/bdii-top-slapd.conf $(prefix)/etc/bdii/ - @install -m 0644 etc/DB_CONFIG $(prefix)/etc/bdii/ - @install -m 0644 etc/DB_CONFIG_top $(prefix)/etc/bdii/ - @install -m 0644 etc/default.ldif $(prefix)/var/lib/bdii/gip/ldif/ + @install -m 0755 etc/init.d/bdii $(prefix)/$(init_dir)/ + @install -m 0644 etc/sysconfig/bdii $(prefix)/etc/sysconfig/ + @install -m 0755 bin/bdii-update $(prefix)/usr/sbin/ + @install -m 0644 etc/bdii.conf $(prefix)/etc/bdii/ + @install -m 0644 etc/BDII.schema $(prefix)/etc/bdii/ + @install -m 0640 etc/bdii-slapd.conf $(prefix)/etc/bdii/ + @install -m 0640 etc/bdii-top-slapd.conf $(prefix)/etc/bdii/ + @install -m 0644 etc/DB_CONFIG $(prefix)/etc/bdii/ + @install -m 0644 etc/DB_CONFIG_top $(prefix)/etc/bdii/ + @install -m 0644 etc/default.ldif $(prefix)/var/lib/bdii/gip/ldif/ @install -m 0644 etc/logrotate.d/bdii $(prefix)/etc/logrotate.d - @install -m 0644 man/bdii-update.1 $(prefix)/usr/share/man/man1/ + @install -m 0644 man/bdii-update.1 $(prefix)/usr/share/man/man1/ @install -m 0644 README.md $(prefix)/usr/share/doc/bdii/ - @install -m 0644 AUTHORS $(prefix)/usr/share/doc/bdii/ + @install -m 0644 AUTHORS.md $(prefix)/usr/share/doc/bdii/ @install -m 0644 COPYRIGHT $(prefix)/usr/share/doc/bdii/ @install -m 0644 LICENSE.txt $(prefix)/usr/share/doc/bdii/ @@ -49,15 +49,12 @@ sources: dist cp $(build)/$(NAME)-$(VERSION).tar.gz . -deb: dist - cd $(build)/$(NAME)-$(VERSION); dpkg-buildpackage -us -uc; cd - - prepare: dist - @mkdir -p $(build)/RPMS/noarch - @mkdir -p $(build)/SRPMS/ - @mkdir -p $(build)/SPECS/ - @mkdir -p $(build)/SOURCES/ - @mkdir -p $(build)/BUILD/ + @mkdir -p $(build)/RPMS/noarch + @mkdir -p $(build)/SRPMS/ + @mkdir -p $(build)/SPECS/ + @mkdir -p $(build)/SOURCES/ + @mkdir -p $(build)/BUILD/ cp $(build)/$(NAME)-$(VERSION).tar.gz $(build)/SOURCES cp $(NAME).spec $(build)/SPECS @@ -65,7 +62,7 @@ rpmbuild -bs --define="dist ${dist}" --define='_topdir ${build}' $(build)/SPECS/$(NAME).spec rpm: srpm - rpmbuild --rebuild --define='_topdir ${build}' --define="dist ${dist}" $(build)/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)${dist}.src.rpm + rpmbuild --rebuild --define='_topdir ${build}' --define="dist ${dist}" $(build)/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)$(dist).src.rpm clean: rm -f *~ $(NAME)-$(VERSION).tar.gz diff -Nru bdii-5.2.26/man/bdii-update.1 bdii-6.0.0/man/bdii-update.1 --- bdii-5.2.26/man/bdii-update.1 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/man/bdii-update.1 2022-12-16 14:40:21.000000000 +0000 @@ -16,7 +16,7 @@ .B plugin directory. The difference between providers and plugins is that providers return complete entries and plugins provide modifications to existing entries. -The process can be run either as a daemon that periodically syncronizes an LDAP database or as a command that will print the result to stdout. +The process can be run either as a daemon that periodically synchronizes an LDAP database or as a command that will print the result to stdout. .SH OPTIONS .IP -d Run as a daemon process. diff -Nru bdii-5.2.26/README.md bdii-6.0.0/README.md --- bdii-5.2.26/README.md 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/README.md 2022-12-16 14:40:21.000000000 +0000 @@ -1,65 +1,78 @@ -# README for bdii package +# BDII -Documentation: [bdii.readthedocs.io](http://bdii.readthedocs.io) +Documentation: [bdii.readthedocs.io](http://bdii.readthedocs.io). ## Function -The Berkeley Database Information Index (BDII) consists of two or more -standard LDAP databases that are populated by an update process. -Port forwarding is used to enable one or more databases to serve data -while one database is being refreshed. The databases are refreshed -cyclically. Any incoming connection is forwarded to the most recently -updated database, while old connections are allowed to linger until -it is the turn of their database to be refreshed and restarted. -The update process obtains LDIF from either doing an ldapsearch on LDAP -URLs or by running a local script (given by a URL with "file" protocol) -that generates LDIF. The LDIF is then inserted into the LDAP database. -Options exist to update the list of LDAP URLs from a web page and -to use an LDIF file from a web page to modify the data before it is -inserted into the database. +The Berkeley Database Information Index (BDII) consists of two or more standard +LDAP databases that are populated by an update process. Port forwarding is used +to enable one or more databases to serve data while one database is being +refreshed. The databases are refreshed cyclically. Any incoming connection is +forwarded to the most recently updated database, while old connections are +allowed to linger until it is the turn of their database to be refreshed and +restarted. The update process obtains LDIF from either doing an `ldapsearch` on +LDAP URLs or by running a local script (given by a URL with "file" protocol) +that generates LDIF. The LDIF is then inserted into the LDAP database. Options +exist to update the list of LDAP URLs from a web page and to use an LDIF file +from a web page to modify the data before it is inserted into the database. ## Cache use -Whenever a remote server is contacted and the ldapsearch command times out -the update process tries to find an (old) cached entry in the `/var/cache/` +Whenever a remote server is contacted and the `ldapsearch` command times out the +update process tries to find an (old) cached entry in the `/var/cache/` directory. If no entry is found a message is printed to the logfile. -_Attention!_ -If the remote host cannot be contacted due to a connection problem +_Attention!_ If the remote host cannot be contacted due to a connection problem no cached entry is taken. No message is printed to the logfile. ## Compressed Content Exchange Mechanism (CCEM) -The Compressed Content Exchange Mechanism is intended to speed up the -gathering of information in case of a ldapsearch to another BDII instance. -The update process first tries to find the entry containing the compressed -content of the queried instance and subsequently adds the information to -its upcoming database. If the CCEM fails the normal procedure as described -in the previous paragraph is executed. -The CCEM function is enabled by default in version `>= 3.9.1`. To disable, -add the following to your bdii.conf: +The Compressed Content Exchange Mechanism is intended to speed up the gathering +of information in case of a `ldapsearch` to another BDII instance. The update +process first tries to find the entry containing the compressed content of the +queried instance and subsequently adds the information to its upcoming database. +If the CCEM fails the normal procedure as described in the previous paragraph is +executed. The CCEM function is enabled by default in version `>= 3.9.1`. To +disable, add the following to your `bdii.conf`: -``` +```shell BDII_CCEM=no ``` ## BDII Status Information Mechanism (BSIM) The BDII Status Information Mechanism is intended to allow better monitoring -possibilities, spotting of upraising problems and resulting failure prevention. -It adds status information about the BDII instance into the 'o=infosys' root -containing metrics like the number of entries added in the last cycle, -the time to do so, etc. -The description of thoese metrics can be found in the etc/BDII.schema file. +possibilities, spotting of upraising problems and resulting error prevention. +It adds status information about the BDII instance into the `o=infosys` root +containing metrics like the number of entries added in the last cycle, the time +to do so, etc. The description of those metrics can be found in the +`etc/BDII.schema` file. ## Installing from source -```sh -make install +```shell +$ make install ``` - Build dependencies: None -- Runtime dependencies: openldap +- Runtime dependencies: openldap, python3 + +## Installing from packages + +### On RHEL-based systems + +For RHEL-based systems, it's possible to install packages from two sources: + +- [EGI UMD packages](https://go.egi.eu/umd) build from this repository, and + tested to work with other components part of the Unified Middleware + Distribution. +- [Fedora and EPEL packages](https://packages.fedoraproject.org/search?query=bdii) + maintained by Mattias Ellert. + +### On debian + +[Official debian packages](https://packages.debian.org/search?keywords=bdii) +are maintained by Mattias Ellert. ## Building packages @@ -70,50 +83,37 @@ - rpm-build - make - rsync +- systemd-rpm-macros, for RHEL >= 8 -```sh +```shell # Checkout tag to be packaged -git clone https://github.com/EGI-Foundation/bdii.git -cd bdii -git checkout X.X.X +$ git clone https://github.com/EGI-Federation/bdii.git +$ cd bdii +$ git checkout X.X.X # Building in a container -docker run --rm -v $(pwd):/source -it centos:7 -yum install -y rpm-build make rsync -cd /source && make rpm +$ docker run --rm -v $(pwd):/source -it quay.io/centos/centos:7 +[root@2fd110169c55 /]# yum install -y rpm-build make rsync +[root@2fd110169c55 /]# cd /source && make rpm ``` The RPM will be available into the `build/RPMS` directory. ### Building a deb -```sh -# Checkout tag to be packaged -git clone https://github.com/EGI-Foundation/bdii.git -cd bdii -git checkout X.X.X -# Building in a container using the source files -docker run --rm -v $(pwd):/source -it ubuntu:xenial -apt update -apt install -y devscripts debhelper make rsync python-all-dev -cd /source && make deb -``` - -The DEB will be available into the `build/` directory. +Debian build files maintained by Mattias Ellert are available in the +[Debian Salsa GitLab](https://salsa.debian.org/ellert/bdii/). ## Preparing a release - Prepare a changelog from the last version, including contributors' names - Prepare a PR with - - Updating version and changelog in `bdii.spec` - - Updating version and changelog in `debian/changelog` - - Updating authors in `AUTHORS` - - Updating `codemeta.json` if needed + - Updating version and changelog in `CHANGELOG` and `bdii.spec` + - Updating `codemeta.json`, if needed - Once the PR has been merged tag and release a new version in GitHub - - Packages will be built using Travis and attached to the release page + - Packages will be built using GitHub Actions and attached to the release page ## History This work started under the EGEE project, and was hosted and maintained for a -long time by CERN. -This is now hosted here on GitHub, maintained by the BDII community with -support of members of the EGI Federation. +long time by CERN. This is now hosted here on GitHub, maintained by the BDII +community with support of members of the EGI Federation. diff -Nru bdii-5.2.26/.travis.yml bdii-6.0.0/.travis.yml --- bdii-5.2.26/.travis.yml 2020-09-23 13:57:33.000000000 +0000 +++ bdii-6.0.0/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ ---- -sudo: required -services: - - docker -language: python -python: - - "2.7" -env: - global: - - OS_NAME=centos - matrix: - - OS_MAJOR_VERSION=6 - - OS_MAJOR_VERSION=7 -before_install: - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - sudo apt update - - sudo apt install -y docker-ce - - docker --version -install: - - wget http://archive.ubuntu.com/ubuntu/pool/universe/r/rpmlint/rpmlint_1.7-1_all.deb - - sudo dpkg -i rpmlint_1.7-1_all.deb || sudo apt install -f -y - - gem install mdl - - if [[ $TRAVIS_PYTHON_VERSION == 2.6 ]]; then pip install 'flake8<3.0.0'; fi - - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install flake8 flake8-import-order hacking; fi -script: - # First syntax, linting and pre-test stages - - mdl -s relaxed README.md - - rpmlint bdii.spec - - flake8 bin/bdii-update - # Then, start the build container - - docker run --name build_container -d -ti -v $PWD:/src -w /src $OS_NAME:$OS_MAJOR_VERSION sh -c 'while true ; do sleep 1000 ; done' - # Now, install prerequisites for the build - - docker exec -i -w /root build_container yum install -y rpm-build rpmlint make rsync - # Eventually build the rpm - - docker exec -i -w /src build_container make rpm - # lint the RPM - - docker exec -i -w /src/build build_container rpmlint --file ../.rpmlint.ini RPMS/ - # Now, start the test container - - docker run --name install_container -d -ti -v $PWD:/src -w /src $OS_NAME:$OS_MAJOR_VERSION sh -c 'while true ; do sleep 1000 ; done' - # and install it - - docker exec -i -w /src/build/RPMS/noarch install_container yum install -y epel-release - - docker exec -i -w /src/build/RPMS/noarch install_container sh -c "yum localinstall -y bdii*.el${OS_MAJOR_VERSION}.noarch.rpm" -deploy: - provider: releases - # Set in the settings page of the repository, as an environment variable - api_key: $GITHUB_TOKEN - file_glob: true - file: - - build/RPMS/noarch/bdii*.el${OS_MAJOR_VERSION}.noarch.rpm - - build/SRPMS/bdii*.el${OS_MAJOR_VERSION}.src.rpm - on: - tags: true