[debian-edu-commits] debian-edu/shutdown-at-night.git (#51) - master (branch) updated: 19c7ab6e1d49ca2dcadd27d5fb400cfe9c0efb6a

Mike Gabriel sunweaver at alioth.debian.org
Wed Oct 23 09:33:57 UTC 2013


The branch, master has been updated
       via  19c7ab6e1d49ca2dcadd27d5fb400cfe9c0efb6a (commit)
      from  4050dbd5c27a77dc2084c5c8f53c05a8b2ee39c3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 19c7ab6e1d49ca2dcadd27d5fb400cfe9c0efb6a
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Mon Jul 15 15:25:48 2013 +0000

    Add support for extending the "busy" detection in
    shutdown-at-night by adding code to run hooks in
    /etc/shutdown-at-night/unused.d and
    /usr/lib/shutdown-at-night/unused.d. (Closes: #619950)
    
    git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@81709 6e500793-9bee-0310-a5b0-9d0909bd054d

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog  |    4 ++++
 shutdown-at-night |   13 +++++++++++++
 2 files changed, 17 insertions(+)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index c93f3af..e868ca6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ shutdown-at-night (0.11) UNRELEASED; urgency=low
 
   * Quiet down cron job to wake up client to not complain when fping
     notice they are unavailable.
+  * Add support for extending the "busy" detection in
+    shutdown-at-night by adding code to run hooks in
+    /etc/shutdown-at-night/unused.d and
+    /usr/lib/shutdown-at-night/unused.d. (Closes: #619950)
 
  -- Petter Reinholdtsen <pere at debian.org>  Mon, 15 Jul 2013 16:56:35 +0200
 
diff --git a/shutdown-at-night b/shutdown-at-night
index c9c97c1..0a417b7 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -15,6 +15,10 @@ wakeuptime="07:00"
 hostname="$(uname -n)"
 netgroupname="shutdown-at-night-hosts"
 
+# Hook directories to allow custom code to detect if a machine is used
+# or not.
+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
@@ -70,6 +74,15 @@ is_host_unused() {
     if (( $(cat /proc/uptime  | awk '{print int($1)}') < 3600 )) ; then
         return 1
     fi
+    for dir in $unuseddlist ; do
+	if [ -d $dir ] ; then
+            for f in $dir/* ; do
+		if [ -x $f ] && ! $f ; then
+                    return 1
+		fi
+            done
+	fi
+    done
     return 0
 }
 


hooks/post-receive
-- 
shutdown-at-night.git (shutdown-at-night Debian package)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "shutdown-at-night.git" (shutdown-at-night Debian package).




More information about the debian-edu-commits mailing list