summaryrefslogtreecommitdiffstats
path: root/core/modules/idleaction/data
diff options
context:
space:
mode:
authorSimon Rettberg2017-11-29 22:09:26 +0100
committerYour Name2017-11-29 22:09:26 +0100
commitbd25e34bc73a887f5f745c14fedb395bbe54c7a8 (patch)
tree90368450c572639f45d539ec3bacab3466306c17 /core/modules/idleaction/data
parent[vmware*] Only create /dev/vmmon if it doesn't exist (diff)
downloadmltk-bd25e34bc73a887f5f745c14fedb395bbe54c7a8.tar.gz
mltk-bd25e34bc73a887f5f745c14fedb395bbe54c7a8.tar.xz
mltk-bd25e34bc73a887f5f745c14fedb395bbe54c7a8.zip
[idleaction] Timing fixes
Diffstat (limited to 'core/modules/idleaction/data')
-rwxr-xr-xcore/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action2
-rwxr-xr-xcore/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init2
2 files changed, 3 insertions, 1 deletions
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
index 5e279c34..68920709 100755
--- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
+++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
@@ -37,6 +37,8 @@ done
if [ -n "$TS" ]; then
# Sanity check for trigger by cron
+ # Sleep first so the clock has time to get adjusted
+ sleep 10
NOW=$(date +%s)
SHOULD=$(date -d "today $TS" +%s)
DIFF=$(( NOW - SHOULD ))
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init b/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init
index 304b4a63..7c3afa00 100755
--- a/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init
+++ b/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init
@@ -32,7 +32,7 @@ if [ -n "$SCHEDULE" ]; then
TODAY=$(date +%Y-%m-%d)
# Use tomorrow instead of adding 86400 seconds so it (hopefully) works when DST changes
TOMORROW=$(date --date="+1 day" +%Y-%m-%d)
- NOW=$(date --date="+1 minute" +%s) # don't wake up again immediately
+ NOW=$(date +%s)
for t in $SCHEDULE; do
HOUR=${t%%:*}
MINUTE=${t##*:}