[Lunar-commits] <moonbase> systemd: don't ask for virtual services (@), also just install with 0644.

Auke Kok sofar at foo-projects.org
Mon Jun 13 06:21:25 CEST 2011


commit 9b1aa12f61985c367dbbf56a03d44ab2cf676ae2
Author: Auke Kok <auke at foo-projects.org>
Date:   Mon Jun 13 06:21:25 2011 +0200

    systemd: don't ask for virtual services (@), also just install with 0644.
---
 zbeta/systemd/plugin.d/systemd.plugin |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/zbeta/systemd/plugin.d/systemd.plugin b/zbeta/systemd/plugin.d/systemd.plugin
index dc06546..4b37402 100644
--- a/zbeta/systemd/plugin.d/systemd.plugin
+++ b/zbeta/systemd/plugin.d/systemd.plugin
@@ -22,12 +22,19 @@ plugin_systemd_configure()
 
     SYSTEMD_SERVICES=
     for SERVICE in $SERVICES; do
+      # don't ask for '@' services - these should always be installed but
+      # never linked directly.
+      if echo $SERVICE | grep -q @ ; then
+        continue
+      fi
+      message "${MESSAGE_COLOR}$SERVICE: $(grep Description= $SERVICE | cut -d= -f2-)${DEFAULT_COLOR}"
       if query "Invoke $SERVICE via systemd automatically at boot ?"  y
       then
         SYSTEMD_SERVICES+=" $SERVICE"
       else
-        systemctl disable $SERVICE
-	systemctl stop $SERVICE
+        # ignore output here - this is likely to hit "not found" errors
+        systemctl disable $SERVICE > /dev/null 2>&1
+	systemctl stop $SERVICE > /dev/null 2>&1
       fi
     done
     cd $SCRIPT_DIRECTORY
@@ -50,13 +57,13 @@ plugin_systemd_post_build()
     SERVICES=$(ls -1)
 
     for SERVICE in $SERVICES; do
-      /usr/bin/install -g 0 -o 0 -m 0755 $SERVICE /lib/systemd/system/$SERVICE
+      /usr/bin/install -g 0 -o 0 -m 0644 $SERVICE /lib/systemd/system/$SERVICE
     done
     cd $SCRIPT_DIRECTORY
     devoke_installwatch
   fi
 
-  systemctl daemon-reload
+  systemctl daemon-reload > /dev/null 2>&1
 
   for SERVICE in $SYSTEMD_SERVICES; do
     systemctl disable $SERVICE


More information about the Lunar-commits mailing list