[debian-edu-commits] debian-edu/ 01/01: Rewrite init-ltsp.d/60-edu-client to disable all services the same way, reduce duplicate code and work with sysv-rc based systems too.

Petter Reinholdtsen pere at moszumanska.debian.org
Mon Oct 13 15:23:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository debian-edu-config.

commit 38f311b07c6bd47f04eb81a23f47df8f6a63275a
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Mon Oct 13 17:23:21 2014 +0200

    Rewrite init-ltsp.d/60-edu-client to disable all services the same way, reduce duplicate code and work with sysv-rc based systems too.
---
 debian/changelog                     |  4 +++
 share/ltsp/init-ltsp.d/60-edu-client | 49 +++++++++++++++++++++++-------------
 2 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cf7a33f..251633d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -58,6 +58,10 @@ debian-edu-config (1.810) UNRELEASED; urgency=high
   [ Debconf translation updates ]
   * Dutch by Frans Spiesschaert (Closes: #763639)
 
+  [ Petter Reinholdtsen ]
+  * Rewrite init-ltsp.d/60-edu-client to disable all services the same
+    way, reduce duplicate code and work with sysv-rc based systems too.
+
  -- Wolfgang Schweer <wschweer at arcor.de>  Tue, 07 Oct 2014 12:47:06 +0200
 
 debian-edu-config (1.809) unstable; urgency=high
diff --git a/share/ltsp/init-ltsp.d/60-edu-client b/share/ltsp/init-ltsp.d/60-edu-client
index 501aad3..61b52de 100644
--- a/share/ltsp/init-ltsp.d/60-edu-client
+++ b/share/ltsp/init-ltsp.d/60-edu-client
@@ -1,32 +1,45 @@
 #!/bin/sh
+
+service_disable() {
+    service="$1"
+    if [ -d  /run/systemd/system ] \
+       && [ -f /lib/systemd/system/gdm3.service ] ; then
+        systemctl disable ${service}.service
+    else
+        update-rc.d $service disable || true
+    fi
+}
+
 # Use systemd compliant systemctl.
 # Remove unused dm services if ldm is used.
 if [ -z "$DEFAULT_DISPLAY_MANAGER" ]; then
-    if [ -f /lib/systemd/system/lightdm.service ] ; then
-	systemctl disable lightdm.service
-    fi
-    if [ -f /lib/systemd/system/kdm.service ] ; then
-	systemctl disable kdm.service
-    fi
-    if [ -f /lib/systemd/system/gdm3.service ] ; then
-	systemctl disable gdm3.service
-    fi
+    for service in \
+        lightdm \
+        kdm \
+        gdm3 \
+      ; do
+        service_disable $service
+    done
 fi
 
 # For Debian Edu diskless workstations (i.e. ltsp fat clients).
 if boolean_is_true "$LTSP_FATCLIENT" && [ -z "$DEFAULT_DISPLAY_MANAGER" ]; then
     # Remove autofs to let sshfs mount home dir (LDM is used).
-    systemctl disable autofs.service
+    service_disable autofs
 fi
 
 # Remove useless services for thin clients.
 if ! boolean_is_true "$LTSP_FATCLIENT" ; then
-    systemctl disable cups-browsed.service
-    systemctl disable autofs.service
-    systemctl disable inetd.service
-    systemctl disable rpcbind.service
-    systemctl disable ntp.service
-    systemctl disable nfs-common.service
-    systemctl disable nslcd.service
-    systemctl disable nscd.service
+    for service in \
+        cups-browsed \
+        autofs \
+        inetd \
+        rpcbind \
+        ntp \
+        nfs-common \
+        nslcd \
+        nscd \
+      ; do
+        service_disable $service
+    done
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list