[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] Adjust debian/debian-edu-config.postinst
Wolfgang Schweer (@schweer-guest)
gitlab at salsa.debian.org
Sun Oct 3 10:32:56 BST 2021
Wolfgang Schweer pushed to branch master at Debian Edu / debian-edu-config
Commits:
b559e327 by Wolfgang Schweer at 2021-10-03T11:32:04+02:00
Adjust debian/debian-edu-config.postinst
Use 'command -v' instead if deprecated 'which'.
Adjust LDAP data base related entry.
Cleanup from no longer needed versioned edits/removals.
Signed-off-by: Wolfgang Schweer <wschweer at arcor.de>
- - - - -
1 changed file:
- debian/debian-edu-config.postinst
Changes:
=====================================
debian/debian-edu-config.postinst
=====================================
@@ -48,7 +48,7 @@ fi
# Execute early, to get the state before changes activated by this
# package is done.
-if which etckeeper > /dev/null ; then
+if command -v etckeeper > /dev/null ; then
etckeeper commit "start of debian-edu-config postinst" || true
fi
@@ -108,53 +108,6 @@ fi
case "$1" in
configure)
- if dpkg --compare-versions "$2" le "2.10.49" ; then
- if [ -f /etc/ldap/ldap.conf ] ; then
- sed -i 's#/etc/ldap/ssl/ldap-server-pubkey.pem#/etc/ssl/certs/debian-edu-server.crt#' /etc/ldap/ldap.conf
- fi
- if [ -f /etc/nslcd.conf ] ; then
- sed -i 's#/etc/ldap/ssl/ldap-server-pubkey.pem#/etc/ssl/certs/debian-edu-server.crt#' /etc/nslcd.conf
- fi
- if egrep -q "(Main-Server)" /etc/debian-edu/config ; then
- rm -f /etc/ldap/ssl/slapd.pem
- rm -f /etc/ldap/slapd.conf
- if [ -f /etc/ldap/slapd-debian-edu.conf ] ; then
- ln -s /etc/ldap/slapd-debian-edu.conf /etc/ldap/slapd.conf
- fi
- if [ -f /usr/share/debian-edu-config/tools/create-debian-edu-certs ] && \
- ! running_from_di ; then
- /usr/share/debian-edu-config/tools/create-debian-edu-certs --force-overwrite
- fi
- else
- if ! egrep -q "(Standalone)" /etc/debian-edu/config ; then
- invoke-rc.d fetch-ldap-cert restart
- invoke-rc.d nslcd restart
- fi
- fi
- rm -f /etc/ldap/ssl/ldap-server-pubkey.pem
- rm -f /etc/ldap/ssl/slapd-cert.cnf
- rm -f /etc/ldap/slapd-squeeze_debian-edu.conf
- fi
-
- if dpkg --compare-versions "$2" le "2.10.19" && \
- [ -f /usr/share/man/man1/.1.gz ] ; then
- rm /usr/share/man/man1/.1.gz
- fi
-
- if dpkg --compare-versions "$2" le "2.10.21" && \
- [ -f /etc/samba/smbldap-machineadd-gosa ] ; then
- rm /etc/samba/smbldap-machineadd-gosa
- fi
-
- if dpkg --compare-versions "$2" le "2.10.22" ; then
- if [ -f /etc/kderc ] ; then
- rm /etc/kderc
- fi
- if [ -f /etc/kde-user-profile ] ; then
- rm /etc/kde-user-profile
- fi
- fi
-
# sssd refuses to read the file if it has any other mode
chmod 600 /etc/sssd/sssd-debian-edu.conf
chown root:root /etc/sssd/sssd-debian-edu.conf
@@ -193,66 +146,6 @@ configure)
cp /etc/cfengine3/debian-edu/promises.cf /var/lib/cfengine3/inputs
fi
- # Set proper rights for users - see #946797
- if dpkg --compare-versions "$2" le "2.11.9" ; then
- if [ -f /etc/krb5kdc/kadm5.acl ] ; then
- sed -i 's/\(\*@INTERN[[:space:]]*\)cil/\1CIl/' /etc/krb5kdc/kadm5.acl
- service krb5-admin-server restart
- fi
- fi
-
- # Remove leftover directory from LTSP5 configuration
- if dpkg --compare-versions "$2" le "2.11.16" ; then
- rm -rf /etc/ltspfs
- rm -f /etc/ltsp/ltsp-build-client.conf
- fi
-
- # Remove leftover files from Samba NT4-style PDC configuration
- if dpkg --compare-versions "$2" le "2.11.32" ; then
- rm -rf /etc/samba/netlogon
- rm -f /etc/samba/samba-domain-policy.ldif
- rm -f /etc/samba/smbaddclient.sh
- fi
- # Remove leftover files from CUPS related workaround
- if dpkg --compare-versions "$2" le "2.11.42" ; then
- rm -rf /usr/lib/systemd/cups.service.d
- fi
- # Remove no longer used freeradius setup template files.
- if dpkg --compare-versions "$2" le "2.11.44" ; then
- rm -f /usr/share/debian-edu-config/freeradius-eap.conf
- rm -f /usr/share/debian-edu-config/freeradius-mschap.conf
- rm -f /usr/share/debian-edu-config/freeradius-authorize
- rm -f /usr/share/debian-edu-config/freeradius-clients.conf
- fi
- # Remove symlink for additional squid file to avoid a permission pitfall.
- # Instead, cf3/cf.squid is used to copy the file.
- # Remove some other leftover symlinks now pointing nowhere.
- if dpkg --compare-versions "$2" le "2.11.45" ; then
- if [ -h /etc/squid/conf.d/debian-edu.conf ] ; then
- rm -f /etc/squid/conf.d/debian-edu.conf
- fi
- if [ -h /etc/X11/Xsession.d/55xfce4-session-debian-edu ] ; then
- rm -f /etc/X11/Xsession.d/55xfce4-session-debian-edu
- fi
- if [ -h /etc/X11/Xsession.d/99edu-firefox-nfs ] ; then
- rm -f /etc/X11/Xsession.d/99edu-firefox-nfs
- fi
- if [ -h /etc/xdg/xfce4/panel/default.xml ] ; then
- rm -f /etc/xdg/xfce4/panel/default.xml
- fi
- if [ -h /etc/resolvconf/update-libc.d/squid ] ; then
- rm -f /etc/resolvconf/update-libc.d/squid
- fi
- if [ -h /etc/profile.d/edu-firefox-nfs.sh ] ; then
- rm -f /etc/profile.d/edu-firefox-nfs.sh
- fi
- fi
- # Ensure the main server interfaces file doesn't contain post-up stanzas.
- if dpkg --compare-versions "$2" lt "2.11.50" ; then
- if [ -f /etc/network/interfaces ] && grep -qE "(Main-Server)" /etc/debian-edu/config; then
- sed -i '/post-up/d' /etc/network/interfaces
- fi
- fi
# Move LDAP BDB data base to default MDB one.
if dpkg --compare-versions "$2" le "2.12.1" && grep -q Main-Server /etc/debian-edu/config && \
[ ! -f /var/lib/ldap/data.mdb ] && ! running_from_di ; then
@@ -260,7 +153,6 @@ configure)
slapcat > $TMPDIR/all.ldif
service slapd stop
rm /var/lib/ldap/*
- cp /usr/share/debian-edu-config/slapd-debian-edu-mdb.conf /etc/ldap
ln -sf /etc/ldap/slapd-debian-edu-mdb.conf /etc/ldap/slapd.conf
service slapd start
slapadd -l $TMPDIR/all.ldif
@@ -274,16 +166,8 @@ esac
#DEBHELPER#
-#fix symlink for exim4.conf, related to #1264
-if [ -h /etc/exim4/exim4.conf ] && [ -x /etc/init.d/exim4 ] ; then
- if [ $(readlink /etc/exim4/exim4.conf) = "/etc/exim/exim-ldap-client-v4.conf" ] ; then
- ln -sf /etc/exim4/exim-ldap-client-v4.conf /etc/exim4/exim4.conf
- invoke-rc.d exim4 reload
- fi
-fi
-
# Register all changes done by this postinst script
-if which etckeeper > /dev/null ; then
+if command -v etckeeper > /dev/null ; then
etckeeper commit "end of debian-edu-config postinst" || true
fi
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/b559e327c71d0e3c006e0f26965559138ac27673
--
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/b559e327c71d0e3c006e0f26965559138ac27673
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20211003/41685ae5/attachment-0001.htm>
More information about the debian-edu-commits
mailing list