Fixing powernap on ubuntu server eoan 19.10

Bug #1854645 reported by Bost
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powernap (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi, I'm sending you a patch to get the powernap running on eoan 19.10 server again.
BTW It's taking me more time trying to get my head around how launchpad platform works. I'm giving up on it and I'm sending you output of:
    git format-patch --stdout HEAD~2..HEAD

Please integrate it where it belongs.
Thanks

From b3224fd6f8c35cd8b4dd71e75c620399e737394f Mon Sep 17 00:00:00 2001
From: Rostislav Svoboda <email address hidden>
Date: Sun, 1 Dec 2019 19:27:49 +0100
Subject: [PATCH 1/2] FIX: systemd target-name

---
 debian/powernap.service | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/powernap.service b/debian/powernap.service
index 1694d4f..b2fea51 100644
--- a/debian/powernap.service
+++ b/debian/powernap.service
@@ -1,7 +1,7 @@
 [Unit]
 Description=PowerNap
-Requires=network.service
-After=network.service
+Requires=network.target
+After=network.target

 [Service]
 Type=forking
--
2.24.0

From d71549020546f454860499cf82f4c7e6dfac8a7c Mon Sep 17 00:00:00 2001
From: Rostislav Svoboda <email address hidden>
Date: Sun, 1 Dec 2019 19:22:39 +0100
Subject: [PATCH 2/2] FIX: ifconfig doesn't exist on 19.10 eoan anymore

---
 powernap-ethtool | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/powernap-ethtool b/powernap-ethtool
index 0cbe866..c5ea289 100755
--- a/powernap-ethtool
+++ b/powernap-ethtool
@@ -5,7 +5,8 @@ if [ -x /etc/powernap/ethtool-command ]; then
     /etc/powernap/ethtool-command
 else
     # Otherwise, try to enable Wake-on-LAN on valid interface(s)
- for i in $(LANG=C /sbin/ifconfig | grep "encap:Ethernet" | awk '{print $1}'); do
+ interfaces=$(basename -a /sys/class/net/*)
+ for i in $interfaces; do
         if /usr/sbin/ethtool $i | grep -qs "Supports Wake-on: .*g"; then
             /usr/sbin/ethtool -s $i wol g
         fi
--
2.24.0

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.