[debian-edu-commits] debian-edu/ 01/01: Provide support for blacklisting shutdown of individual hosts when NIS netgroups are used for controlling shutdown-at-night. (Use "no-shutdown-at-night-hosts" NIS netgroup for black listing hosts that should not shutdown).

Mike Gabriel sunweaver at debian.org
Wed Oct 14 07:21:16 UTC 2015


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

sunweaver pushed a commit to branch master
in repository shutdown-at-night.

commit b6d80b24c1de9e1f380095cbe56b2abe4caae7ba
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Oct 14 09:20:35 2015 +0200

    Provide support for blacklisting shutdown of individual hosts when NIS netgroups are used for controlling shutdown-at-night. (Use "no-shutdown-at-night-hosts" NIS netgroup for black listing hosts that should not shutdown).
---
 debian/changelog  | 7 +++++++
 shutdown-at-night | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 083ac4d..f05419c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,15 @@
 shutdown-at-night (0.16) UNRELEASED; urgency=medium
 
+  [ Wolfgang Schweer ]
   * Fix the xsession test to match the special case of gdm3 greeter no
     longer running gdm-simple-greeter. (Closes: #787566).
 
+  [ Mike Gabriel ]
+  * Provide support for blacklisting shutdown of individual hosts
+    when NIS netgroups are used for controlling shutdown-at-night.
+    (Use "no-shutdown-at-night-hosts" NIS netgroup for black listing
+    hosts that should not shutdown).
+
  -- Wolfgang Schweer <wschweer at arcor.de>  Tue, 02 Jun 2015 22:25:43 +0200
 
 shutdown-at-night (0.15) unstable; urgency=medium
diff --git a/shutdown-at-night b/shutdown-at-night
index 11a7840..a9cdf30 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -14,6 +14,7 @@ wakeuptime="07:00"
 
 hostname="$(uname -n)"
 netgroupname="shutdown-at-night-hosts"
+netgroupname_noshutdown="no-shutdown-at-night-hosts"
 
 # Hook directories to allow custom code to detect if a machine is used
 # or not.
@@ -22,7 +23,9 @@ unuseddlist="/etc/shutdown-at-night/unused.d /usr/lib/shutdown-at-night/unused.d
 in_netgroup() {
     # Try both long and short name
     for h in "$(uname -n)" "$(hostname -s)" ; do
-        if innetgr -h "$h" "$netgroupname" ; then
+        if innetgr -h "$h" "$netgroupname_noshutdown"; then
+            return 1
+        elif innetgr -h "$h" "$netgroupname" ; then
             return 0
         fi
     done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/shutdown-at-night.git



More information about the debian-edu-commits mailing list