[debian-edu-commits] debian-edu/shutdown-at-night.git (#21) - master (branch) updated: 2132d461342cb973cd00b28ef2bff35c8246df6d

Mike Gabriel sunweaver at alioth.debian.org
Wed Oct 23 09:52:06 UTC 2013


The branch, master has been updated
       via  2132d461342cb973cd00b28ef2bff35c8246df6d (commit)
      from  47e472d59e55a82c48b752c3bf86ad7fe0998c28 (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 2132d461342cb973cd00b28ef2bff35c8246df6d
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Fri Jun 13 14:50:54 2008 +0000

      * Change shutdown-at-night to abort the shutdown if wake-on-lan could
        not be enabled.
      * Add 'cron | fcron' as dependency, to make sure the cron jobs
        run as they should.
    
    git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@41463 6e500793-9bee-0310-a5b0-9d0909bd054d

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

Summary of changes:
 debian/changelog  |    4 ++++
 debian/control    |    3 ++-
 shutdown-at-night |    9 ++++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index c2af269..b34af1f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ shutdown-at-night (0.4) UNRELEASED; urgency=low
 
   * Make sure the /etc/shutdown-at-night/ directory is part of the
     package.
+  * Change shutdown-at-night to abort the shutdown if wake-on-lan could
+    not be enabled.
+  * Add 'cron | fcron' as dependency, to make sure the cron jobs
+    run as they should.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 13 Jun 2008 11:11:41 +0200
 
diff --git a/debian/control b/debian/control
index 57e5170..7f2b197 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,8 @@ Build-Depends: debhelper (>= 5), cdbs
 
 Package: shutdown-at-night
 Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}, wakeonlan, ng-utils, fping
+Depends: ${misc:Depends}, ${perl:Depends},  cron | fcron,
+ wakeonlan, ng-utils, fping
 Recommends: nvram-wakeup
 Suggests: sitesummary (>= 0.0.41)
 Description: System to shut down clients at night, and wake them in the morning
diff --git a/shutdown-at-night b/shutdown-at-night
index 2a849f8..7b02df6 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -6,6 +6,8 @@
 # How do we decide if it should be enabled for this host?  Netgroup
 # membership?  LDAP search?  Flag file?
 
+#set -e
+
 wakeuptime="07:00"
 
 hostname="$(uname -n)"
@@ -53,13 +55,18 @@ is_host_unused() {
     return 0
 }
 
+fatal() {
+    logger -t shutdown-at-night "$1"
+    exit 1
+}
+
 if enabled_for_host ; then
     if is_host_unused; then
 	logger -t shutdown-at-night "turning off unused client $hostname."
 	if type nvram-wakeup >/dev/null 2>&1 ; then
 	    nvramwakeup $wakeuptime
 	fi
-	prepare_wakeonlan
+	prepare_wakeonlan || fatal "unable to enable wake-on-lan - aborting shutdown."
 	shutdown -h 5 "Unused host being turned off for the night (cron)." < /dev/null > /dev/null 2>&1 &
     fi
 fi


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