[debian-edu-commits] debian-edu/ 24/64: * Make sure to not give the same wakeup time to all BIOSes, to avoid machines with good hardware clock to wake up at the same time and thus reduce the chance that a fuse breaks.

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 fd5eaa825f377f07c175ebcb12cb374cde8d5d77
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sat Jun 14 22:56:48 2008 +0000

      * Make sure to not give the same wakeup time to all BIOSes, to avoid
        machines with good hardware clock to wake up at the same time and
        thus reduce the chance that a fuse breaks.
    
    git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@41486 6e500793-9bee-0310-a5b0-9d0909bd054d
---
 debian/changelog  |    8 ++++++++
 shutdown-at-night |    8 ++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 759d7ff..e8af74d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+shutdown-at-night (0.5) UNRELEASED; urgency=low
+
+  * Make sure to not give the same wakeup time to all BIOSes, to avoid
+    machines with good hardware clock to wake up at the same time and
+    thus reduce the chance that a fuse breaks.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Sun, 15 Jun 2008 00:51:43 +0200
+
 shutdown-at-night (0.4) unstable; urgency=low
 
   * Make sure the /etc/shutdown-at-night/ directory is part of the
diff --git a/shutdown-at-night b/shutdown-at-night
index 7b02df6..4befaaf 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+# Using /bin/bash and not /bin/sh to get a shell with support for random number
+# generation.
 #
 # Automatically turn off computers at night, defined as 16:00 - 06:00.
 # Should schedule wakeup in the morning.
@@ -28,7 +30,9 @@ enabled_for_host() {
 nvramwakeup() {
 # http://www.vdr-portal.de/board/thread.php?threadid=75582&sid=b7aced20e710aef12ffa56b5197fe168
     wakeuptime=$1
-    when=$(date +%s -d "tomorrow $wakeuptime")
+    # Spread the BIOS wakeup time across a 20 minute period, to avoid all of them
+    # waking up at the same time, killing a fuse.
+    when=$(( $(date +%s -d "tomorrow $wakeuptime") - 600 + $RANDOM % 1200))
 
     # Make sure HW clock is correct, as it is used to decide when to
     # wake up.

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