provide sysusers file for ldap user and group creation and restore tmpfiles.d for /run [release 2.6.8-2mamba;Sun Jun 23 2024]

This commit is contained in:
Silvan Calarco 2024-06-24 21:58:42 +02:00
parent 505de1b76e
commit 29697cec89
3 changed files with 21 additions and 94 deletions

View File

@ -1,83 +0,0 @@
#!/bin/bash
#
# ldap This shell script takes care of starting and stopping ldap server (slapd).
#
# chkconfig: 2345 35 65
# description: LDAP stands for Lightweight Directory Access Protocol, used \
# for implementing the industry standard directory services.
# processname: slapd
# config: /etc/openldap/slapd.conf
# pidfile: /var/run/slapd.pid
# source function library
. /etc/init.d/functions
[ -x /usr/bin/db_recover-51 ] && DB_RECOVER=db_recover-51 || DB_RECOVER=db_recover
# source an auxiliary options file if we have one, and pick up OPTIONS,
# SLAPD_OPTIONS, and SLURPD_OPTIONS
[ -r /etc/sysconfig/ldap ] && . /etc/sysconfig/ldap
slapd=/usr/sbin/slapd
[ -x ${slapd} ] || exit 0
RETVAL=0
function start() {
# fix bdb errors
[ -e "/var/lib/ldap/openldap-data/__db.001" ] && \
$DB_RECOVER -h /var/lib/ldap/openldap-data
# start daemons
prog=`basename ${slapd}`
echo -n $"Starting $prog: "
if grep -q ^TLS /etc/openldap/slapd.conf; then
${slapd} -u ldap -h "ldaps:/// ldap:///" $OPTIONS $SLAPD_OPTIONS
else
${slapd} -u ldap $OPTIONS $SLAPD_OPTIONS
fi
evaluate_retval
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldap
return $RETVAL
}
function stop() {
# stop daemons
prog=`basename ${slapd}`
echo -n $"Stopping $prog: "
killproc ${slapd}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] &&
rm -f /var/lock/subsys/ldap /var/run/ldap/slapd.args
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status ${slapd}
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/ldap ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|status|condrestart}"
RETVAL=1
esac
exit $RETVAL

View File

@ -1,6 +1,6 @@
Name: openldap Name: openldap
Version: 2.6.7 Version: 2.6.8
Release: 1mamba Release: 2mamba
Group: System/Servers Group: System/Servers
Summary: An open source implementation of the Lightweight Directory Access Protocol Summary: An open source implementation of the Lightweight Directory Access Protocol
Vendor: openmamba Vendor: openmamba
@ -8,11 +8,11 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.openldap.org URL: https://www.openldap.org
Source0: ftp://ftp.openldap.org/pub/OpenLDAP/%{name}-release/%{name}-%{version}.tgz Source0: ftp://ftp.openldap.org/pub/OpenLDAP/%{name}-release/%{name}-%{version}.tgz
Source1: %{name}-initscript
Source2: %{name}-logrotate Source2: %{name}-logrotate
Source3: %{name}-2.2.15-conf Source3: %{name}-2.2.15-conf
Source4: openldap.service Source4: openldap.service
Source5: openldap.tmpfiles Source5: openldap.tmpfiles
Source6: openldap.sysusers
# patch from Novell developers (evolution-exchange-2.4.0/docs/openldap-ntlm.diff) # patch from Novell developers (evolution-exchange-2.4.0/docs/openldap-ntlm.diff)
Patch0: %{name}-2.4.6-evolution-ntlm.patch Patch0: %{name}-2.4.6-evolution-ntlm.patch
Patch2: %{name}-2.4.24-default_config.patch Patch2: %{name}-2.4.24-default_config.patch
@ -24,7 +24,6 @@ BuildRequires: glibc-devel
BuildRequires: libltdl-devel BuildRequires: libltdl-devel
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: libsasl2-devel BuildRequires: libsasl2-devel
BuildRequires: libsystemd-devel
BuildRequires: libuuid-devel BuildRequires: libuuid-devel
BuildRequires: libxcrypt-devel BuildRequires: libxcrypt-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
@ -107,8 +106,6 @@ This package contains static libraries and header files needed for development.
%setup -q %setup -q
#-D -T #-D -T
#:<< _EOF #:<< _EOF
#cp %{SOURCE3} servers/slapd/slapd.conf
#%patch0 -p1 -b .ntlm
%patch 2 -p1 %patch 2 -p1
%build %build
@ -142,12 +139,10 @@ This package contains static libraries and header files needed for development.
chmod +x %{buildroot}%{_libdir}/lib*.so.* chmod +x %{buildroot}%{_libdir}/lib*.so.*
install -d %{buildroot}/var/lib/%{name}-data install -d %{buildroot}/var/lib/%{name}-data
install -d %{buildroot}/var/run/openldap/
#install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
#install -D -m 644 %{SOURCE4} %{buildroot}/lib/systemd/system/openldap.service install -D -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/openldap.conf
#install -D -m 644 %{SOURCE5} %{buildroot}%_tmpfilesdir/openldap.conf install -D -m0644 %{SOURCE6} %{buildroot}%{_sysusersdir}/openldap.conf
rm -f %{buildroot}%{_sysconfdir}/%{name}/*.default rm -f %{buildroot}%{_sysconfdir}/%{name}/*.default
rm -f %{buildroot}%{_sysconfdir}/%{name}/schema/*.default rm -f %{buildroot}%{_sysconfdir}/%{name}/schema/*.default
@ -180,6 +175,11 @@ rm -f %{buildroot}/var/openldap-data/DB_CONFIG.example
%post -n lib%{name} -p /sbin/ldconfig %post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig %postun -n lib%{name} -p /sbin/ldconfig
%pre -n %{name}-server
%sysusers_create_package openldap %{SOURCE6}
%tmpfiles_create_package openldap %{SOURCE5}
:
%post -n %{name}-server %post -n %{name}-server
%systemd_post slapd %systemd_post slapd
: :
@ -255,13 +255,20 @@ rm -f %{buildroot}/var/openldap-data/DB_CONFIG.example
%{_sbindir}/slapschema %{_sbindir}/slapschema
%{_sbindir}/slaptest %{_sbindir}/slaptest
%{_unitdir}/slapd.service %{_unitdir}/slapd.service
#%{_tmpfilesdir}/openldap.conf %{_tmpfilesdir}/openldap.conf
%{_sysusersdir}/openldap.conf
%dir %attr(700,ldap,ldap) /var/lib/openldap-data %dir %attr(700,ldap,ldap) /var/lib/openldap-data
%config(noreplace) /var/lib/openldap-data/DB_CONFIG %config(noreplace) /var/lib/openldap-data/DB_CONFIG
%{_mandir}/man3/* %{_mandir}/man3/*
%{_mandir}/man8/* %{_mandir}/man8/*
%changelog %changelog
* Sun Jun 23 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.8-2mamba
- provide sysusers file for ldap user and group creation and restore tmpfiles.d for /run
* Tue Jun 04 2024 Automatic Build System <autodist@openmamba.org> 2.6.8-1mamba
- automatic version update by autodist
* Tue Jan 30 2024 Automatic Build System <autodist@openmamba.org> 2.6.7-1mamba * Tue Jan 30 2024 Automatic Build System <autodist@openmamba.org> 2.6.7-1mamba
- automatic version update by autodist - automatic version update by autodist

3
openldap.sysusers Normal file
View File

@ -0,0 +1,3 @@
g ldap -
u ldap - "LDAP Server" /var/lib/openldap
m ldap ldap