From 2a175fd5469cc65460582830b946e4e59c50df5e Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 4 Dec 2017 11:28:23 +0100 Subject: [PATCH] suspend: manage NetworkManager service on suspend/resume NetworkManager was experiencing an unexpected behavior managing the network interfaces on a supend/resume process, then to avoid this undesired behavior the suspend script will stop and restart the NetworkManager service. https://jira.digi.com/browse/DEL-5351 Signed-off-by: Arturo Buzarra --- .../busybox/busybox-1.24.1/ccimx6qpsbc/suspend | 7 +++++++ .../recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend | 7 +++++++ .../recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend index 50e3e59a3..9b5d6ca47 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend @@ -22,6 +22,7 @@ lockfd="9" BT_INIT="/etc/init.d/bluetooth-init" BT_DAEMON="/etc/init.d/bluetooth" +NM_DAEMON="/etc/init.d/networkmanager" usage() { printf "\nSuspend system to RAM memory\n" @@ -31,6 +32,9 @@ usage() { } suspend_interfaces() { + # Stop NetworkManager before suspend + ${NM_DAEMON} stop + # Suspend wireless interfaces if [ -d "/proc/device-tree/wireless" ]; then for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do @@ -60,6 +64,9 @@ resume_interfaces() { done fi + # Resume NetworkManager after suspend + ${NM_DAEMON} start + # Resume bluetooth interface if [ -d "/proc/device-tree/bluetooth" ]; then if [ -n "${up_bt_on_resume}" ]; then diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend index 140645eea..21a30a524 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend @@ -22,6 +22,7 @@ lockfd="9" BT_INIT="/etc/init.d/bluetooth-init" BT_DAEMON="/etc/init.d/bluetooth" +NM_DAEMON="/etc/init.d/networkmanager" usage() { printf "\nSuspend system to RAM memory\n" @@ -31,6 +32,9 @@ usage() { } suspend_interfaces() { + # Stop NetworkManager before suspend + ${NM_DAEMON} stop + # Suspend wireless interfaces if [ -d "/proc/device-tree/wireless" ]; then for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do @@ -67,6 +71,9 @@ resume_interfaces() { ${BT_DAEMON} start >/dev/null fi fi + + # Resume NetworkManager after suspend + ${NM_DAEMON} start } enter_critical_section() { diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend index a74f24d35..969876e33 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend @@ -22,6 +22,7 @@ lockfd="9" BT_INIT="/etc/init.d/bluetooth-init" BT_DAEMON="/etc/init.d/bluetooth" +NM_DAEMON="/etc/init.d/networkmanager" usage() { printf "\nSuspend system to RAM memory\n" @@ -31,6 +32,9 @@ usage() { } suspend_interfaces() { + # Stop NetworkManager before suspend + ${NM_DAEMON} stop + # Suspend wireless interfaces if [ -d "/proc/device-tree/wireless" ]; then for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do @@ -67,6 +71,9 @@ resume_interfaces() { ${BT_DAEMON} start >/dev/null fi fi + + # Resume NetworkManager after suspend + ${NM_DAEMON} start } enter_critical_section() {