diff options
author | Simon Rettberg | 2021-07-09 10:18:46 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-07-09 10:18:46 +0200 |
commit | 354f86a826cea87c598a08f022bba903bae7a7a2 (patch) | |
tree | 8faad2fb5e919c4df9e0129258dcf5b2eb17304e | |
parent | [slxlog] Add module (diff) | |
download | mltk-354f86a826cea87c598a08f022bba903bae7a7a2.tar.gz mltk-354f86a826cea87c598a08f022bba903bae7a7a2.tar.xz mltk-354f86a826cea87c598a08f022bba903bae7a7a2.zip |
[etherwake/idleaction] Try harder to enable WOL
It was reported that WOL is disabled at runtime on some machines, even
though there is a udev rule in place that enables it right when the
interfaces get registered. We can only assume this is a race condition
with adapter initialization, but worst case something else is running
that is interfering with the WOL setting. Now we forcefully re-enable
WOL at boot, every hour, and before standby, for good measure.
3 files changed, 16 insertions, 0 deletions
diff --git a/core/modules/etherwake/data/etc/cron.d/enable-wol b/core/modules/etherwake/data/etc/cron.d/enable-wol new file mode 100644 index 00000000..bd2fd2d2 --- /dev/null +++ b/core/modules/etherwake/data/etc/cron.d/enable-wol @@ -0,0 +1,5 @@ +SHELL=/bin/ash +PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin + +11 * * * * root /opt/openslx/scripts/cron-enable_wol +@reboot root /opt/openslx/scripts/cron-enable_wol diff --git a/core/modules/etherwake/data/opt/openslx/scripts/cron-enable_wol b/core/modules/etherwake/data/opt/openslx/scripts/cron-enable_wol new file mode 100755 index 00000000..ffa7fbb9 --- /dev/null +++ b/core/modules/etherwake/data/opt/openslx/scripts/cron-enable_wol @@ -0,0 +1,8 @@ +#!/bin/ash + +for i in eth0 boot0; do + [ -e "/sys/class/net/$i" ] || continue + ethtool -s "$i" wol g +done + +exit 0 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 7c3afa00..13ac691c 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init +++ b/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init @@ -59,6 +59,9 @@ if [ -n "$TEST" ]; then exit 0 fi +# Enable WOL again, in case it got disabled +/opt/openslx/scripts/cron-enable_wol + if [ -n "$NEXT" ]; then # Set -l and hope it does the right thing on DST rtcwake -l -m no -t "$NEXT" |