[debian-edu-commits] debian-edu/ 21/64: * 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.

Mike Gabriel sunweaver at debian.org
Wed Oct 23 09:51:51 UTC 2013


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 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
---
 debian/changelog  |    4 ++++
 debian/control    |    3 ++-
 shutdown-at-night |    9 ++++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

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

-- 
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