[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] 3 commits: Do not solely rely on the presence of init scripts in maintainer scripts

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Wed Sep 6 12:09:39 BST 2023



Mike Gabriel pushed to branch master at Debian Edu / debian-edu-config


Commits:
9a38129b by Guido Berhoerster at 2023-09-05T14:23:57+02:00
Do not solely rely on the presence of init scripts in maintainer scripts

Check also for systemd service files.

- - - - -
7028af6b by Guido Berhoerster at 2023-09-05T14:25:39+02:00
Remove direct invocation of wlan init script

This no longer exists in Debian.

- - - - -
912fa538 by Guido Berhoerster at 2023-09-05T14:26:50+02:00
Replace invocation of fetch-ldap-cert init script in DHCP hooks

This has been replaced by fetch-rootca-cert (see #971780).

- - - - -


4 changed files:

- debian/debian-edu-config.postrm
- debian/debian-edu-config.prerm
- etc/dhcp/dhclient-exit-hooks.d/fetch-ldap-cert → etc/dhcp/dhclient-exit-hooks.d/fetch-rootca-cert
- etc/ifplugd/ifplugd.action


Changes:

=====================================
debian/debian-edu-config.postrm
=====================================
@@ -5,7 +5,8 @@ set -e
 case "$1" in
     remove)
         # Calling the init script during removal
-	if [ -x "/etc/init.d/enable-nat" ] ; then
+	if /usr/bin/systemctl list-unit-files -q enable-nat >/dev/null 2>&1 || \
+	    [ -x "/etc/init.d/enable-nat" ] ; then
 	    if command -v invoke-rc.d >/dev/null ; then
 		invoke-rc.d enable-nat stop || exit $?
 	    else


=====================================
debian/debian-edu-config.prerm
=====================================
@@ -5,7 +5,8 @@ set -e
 case "$1" in
     remove)
         # Calling the init script during removal
-	if [ -x "/etc/init.d/enable-nat" ] ; then
+	if /usr/bin/systemctl list-unit-files -q enable-nat >/dev/null 2>&1 || \
+	    [ -x "/etc/init.d/enable-nat" ] ; then
 	    if command -v invoke-rc.d >/dev/null ; then
 		invoke-rc.d enable-nat stop || exit $?
 	    else


=====================================
etc/dhcp/dhclient-exit-hooks.d/fetch-ldap-cert → etc/dhcp/dhclient-exit-hooks.d/fetch-rootca-cert
=====================================
@@ -1,16 +1,12 @@
 #!/bin/sh
-# Make sure LDAP certificate is downloaded when the network become
-# available, if the init.d script failed to fetch it at boot.
+# Make sure the DebianEdu root certificate is downloaded when the network
+# becomes available, if the init system service failed to fetch it at boot.
 
 if [ -r /etc/debian-edu/config ] ; then
     . /etc/debian-edu/config
 fi
 
-if [ false = "$DHCP_FETCH_LDAP_CERT" ] ; then
-    exit 0
-fi
-
-# Avoid dependency loop by not calling init.d script when dhclient is
+# Avoid dependency loop by not calling init system service when dhclient is
 # called by init.d/networking.  Workaround for BTS issue #754218.
 if [ -d /run/systemd/system ]; then
     systemctl list-jobs | grep -q network.target && exit 0
@@ -18,7 +14,7 @@ fi
 
 case $reason in
     BOUND|RENEW|REBIND|REBOOT)
-	/etc/init.d/fetch-ldap-cert start
+	/usr/share/debian-edu-config/tools/fetch-rootca-cert
 	;;
     EXPIRE|FAIL|RELEASE|STOP)
 	;;


=====================================
etc/ifplugd/ifplugd.action
=====================================
@@ -30,13 +30,11 @@ if [ -x $WHEREAMI ]; then
   $WHEREAMI --syslog --run_from ifplugd --hint $1,$2
 else
   if [ "$2" = "up" ]; then
-    [ -x /etc/init.d/wlan ] && /etc/init.d/wlan up $1
     /sbin/ifup $1
     exit $?
   elif [ "$2" = "down" ]; then
     /sbin/ifdown $1
     sleep 5
-    [ -x /etc/init.d/wlan ] && /etc/init.d/wlan down $1
     exit $?
   fi
 fi



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/7f7b819882e2fec58fd85d5d52db5248aafed48e...912fa538970efd7175481779a5bde71f6d14d530

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/7f7b819882e2fec58fd85d5d52db5248aafed48e...912fa538970efd7175481779a5bde71f6d14d530
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/20230906/f3c387e1/attachment-0001.htm>


More information about the debian-edu-commits mailing list