diff --git a/CHANGELOG.md b/CHANGELOG.md index d7bb84af..245d6c52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,23 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -#### [4.0.0](https://github.com/rdkcentral/sysint/compare/3.0.8...4.0.0) +#### [4.0.1](https://github.com/rdkcentral/sysint/compare/4.0.0...4.0.1) + +- Revert "RDKEMW-10017 : NetworkManager based connectivity check (#355)" [`#361`](https://github.com/rdkcentral/sysint/pull/361) +- Update update_previous_reboot_info.sh [`#360`](https://github.com/rdkcentral/sysint/pull/360) +- Update warehouse-reset.sh for NM cleanup [`#359`](https://github.com/rdkcentral/sysint/pull/359) +- Merge tag '4.0.0' into develop [`3133a34`](https://github.com/rdkcentral/sysint/commit/3133a3491ac1fdf7a7b2a7a2eefbdc7387124b4a) + +### [4.0.0](https://github.com/rdkcentral/sysint/compare/3.0.8...4.0.0) + +> 3 November 2025 - RDKEMW-10017 : NetworkManager based connectivity check [`#355`](https://github.com/rdkcentral/sysint/pull/355) - Create NetworkManager_ecfs.conf [`#353`](https://github.com/rdkcentral/sysint/pull/353) - WNCXIONE-530: Synching changes from support/2.2.0 branch. [`#350`](https://github.com/rdkcentral/sysint/pull/350) - RDKEMW-9343: Update boot_FSR as part of OPS_TRIGGERED reasons [`#343`](https://github.com/rdkcentral/sysint/pull/343) - RDKEMW-9675 FSR needs to remove NM profile in RDKE also [`#346`](https://github.com/rdkcentral/sysint/pull/346) +- 4.0.0 release changelog updates [`15cd4a1`](https://github.com/rdkcentral/sysint/commit/15cd4a1aab1d7a76563742de849c64895fe2ce67) - Merge tag '3.0.8' into develop [`417596d`](https://github.com/rdkcentral/sysint/commit/417596d0e8d3f71c8b98c7b36a32c205e16cd760) #### [3.0.8](https://github.com/rdkcentral/sysint/compare/3.0.7...3.0.8) diff --git a/lib/rdk/NM_Dispatcher.sh b/lib/rdk/NM_Dispatcher.sh index 97b76055..cfaa0726 100644 --- a/lib/rdk/NM_Dispatcher.sh +++ b/lib/rdk/NM_Dispatcher.sh @@ -107,9 +107,15 @@ interfaceName=$1 interfaceStatus=$2 if [ "$interfaceStatus" = "up" ]; then - + /usr/bin/nm-online -q -t 60 # If Network manager is not online wait for 60 sec. TODO: Revisit this during connectivity check enable time CON_STATE=$(nmcli -t -f GENERAL.STATE device show "$interfaceName" 2>/dev/null | cut -d: -f2) NMdispatcherLog "Connection state of interface $interfaceName=$CON_STATE" + if [ "$CON_STATE" = "100 (connected)" ] || [ "$CON_STATE" = "120 (connected (site only))" ]; then + NMdispatcherLog "Connection state of $interfaceName is connected." + sh /lib/rdk/connectivitycheck.sh & + else + NMdispatcherLog "Connection state of $interfaceName Up But Not Fully connected." + fi fi if [ "x$interfaceName" != "x" ] && [ "$interfaceName" != "lo" ]; then diff --git a/lib/rdk/connectivitycheck.sh b/lib/rdk/connectivitycheck.sh new file mode 100644 index 00000000..341b3e99 --- /dev/null +++ b/lib/rdk/connectivitycheck.sh @@ -0,0 +1,79 @@ +#!/bin/sh +#################################################################################### +# If not stated otherwise in this file or this component's LICENSE file the +# following copyright and licenses apply: +# +# Copyright 2024 Comcast Cable Communications Management, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#################################################################################### + +. /etc/include.properties +. /etc/device.properties + +if [ -f /lib/rdk/t2Shared_api.sh ]; then + source /lib/rdk/t2Shared_api.sh +fi + +CONNCHECK_LOG_FILE="$LOG_PATH/NMMonitor.log" +CONNCHECK_FILE="/tmp/connectivity_check_done" +CONNCHECK_TIMEOUT=120 # 2 minutes +CONNCHECK_RETRY_INTERVAL=10 # 10 seconds + +connectivityCheckLog() +{ + echo "$(/bin/timestamp) : $0: $*" >> $CONNCHECK_LOG_FILE +} + +if [ -n "$CONNECTIVITY_CHECK_URL" ]; then + URL="$CONNECTIVITY_CHECK_URL" +else + connectivityCheckLog "CONNECTIVITY_CHECK_URL not set. Exiting." + if [ ! -f $CONNCHECK_FILE ]; then + touch $CONNCHECK_FILE + fi + t2CountNotify "SYST_WARN_connectivitycheck_nourl_set" + exit 0 +fi + +# Get start time from /proc/uptime (integer part only) +START=$(cut -d. -f1 /proc/uptime) + +while true; do + NOW=$(cut -d. -f1 /proc/uptime) + ELAPSED=$((NOW - START)) + + if [ "$ELAPSED" -ge "$CONNCHECK_TIMEOUT" ]; then + connectivityCheckLog "Failed to get HTTP 204 within $CONNCHECK_TIMEOUT seconds." + if [ ! -f $CONNCHECK_FILE ]; then + touch $CONNCHECK_FILE + fi + t2CountNotify "SYST_WARN_connectivitycheck_time_expire" + exit 0 + fi + + HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL") + + if [ "$HTTP_CODE" -eq 204 ]; then + connectivityCheckLog "Connected: Received HTTP 204" + if [ ! -f $CONNCHECK_FILE ]; then + touch $CONNCHECK_FILE + fi + t2CountNotify "SYST_INFO_connectivitycheck_success" + exit 0 + else + connectivityCheckLog "connectivitycheck.sh Not connected yet (HTTP $HTTP_CODE). Retrying in $CONNCHECK_RETRY_INTERVAL seconds..." + fi + + sleep $CONNCHECK_RETRY_INTERVAL +done diff --git a/lib/rdk/update_previous_reboot_info.sh b/lib/rdk/update_previous_reboot_info.sh index ec0d1f9c..0de94d0d 100755 --- a/lib/rdk/update_previous_reboot_info.sh +++ b/lib/rdk/update_previous_reboot_info.sh @@ -96,8 +96,8 @@ setPreviousRebootInfo() if [ -z "$existing_reboot_info" ]; then echo "$(/bin/timestamp): $0: Updating previous reboot info to Parodus" >> "$PARODUS_LOG" - echo "$(/bin/timestamp): $0: PreviousRebootInfo:$timestamp,$custom,$source,$reason" >> "$PARODUS_LOG" - rebootLog "Reboot Information Updated to parodus log:$timestamp,$custom,$source,$reason" + echo "$(/bin/timestamp): $0: PreviousRebootInfo:$timestamp,$reason,$custom,$source" >> "$PARODUS_LOG" + rebootLog "Reboot Information Updated to parodus log:$timestamp,$reason,$custom,$source" else rebootLog "${FUNCNAME[0]}: Reboot info already present in $PARODUS_LOG as $existing_reboot_info, skipping update" fi diff --git a/lib/rdk/warehouse-reset.sh b/lib/rdk/warehouse-reset.sh index 26073a98..919da39a 100644 --- a/lib/rdk/warehouse-reset.sh +++ b/lib/rdk/warehouse-reset.sh @@ -103,6 +103,8 @@ if [ -e /opt/.gstreamer ]; then rm -rf /opt/.gstreamer; fi if [ -d /opt/persistent/dvr ]; then rm -rf /opt/persistent/dvr; fi if [ -d /opt/etc ];then rm -rf /opt/etc;fi if [ -d /opt/certs ];then rm -rf /opt/certs; fi +if [ -d /opt/NetworkManager ];then rm -rf /opt/NetworkManager ; fi +if [ -d /opt/secure/NetworkManager ];then rm -rf /opt/secure/NetworkManager ; fi if [ -f /opt/secure/Apparmor_blocklist ];then rm -rf /opt/secure/Apparmor_blocklist ; fi diff --git a/systemd_units/coredump-secure-upload.service b/systemd_units/coredump-secure-upload.service index 325d5592..20b9641e 100644 --- a/systemd_units/coredump-secure-upload.service +++ b/systemd_units/coredump-secure-upload.service @@ -21,8 +21,8 @@ [Unit] Description=COREDUMP UPLOAD -After=network-online.target tr69hostif.service -Requires=network-online.target +After=network-up.target tr69hostif.service +Requires=network-up.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 1 secure diff --git a/systemd_units/coredump-upload.service b/systemd_units/coredump-upload.service index eeb4a0ca..fcddd9e0 100644 --- a/systemd_units/coredump-upload.service +++ b/systemd_units/coredump-upload.service @@ -19,8 +19,8 @@ [Unit] Description=COREDUMP UPLOAD -After=network-online.target -Requires=network-online.target +After=network-up.target +Requires=network-up.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 1 diff --git a/systemd_units/minidump-secure-upload.service b/systemd_units/minidump-secure-upload.service index 86ff5115..cb875d14 100644 --- a/systemd_units/minidump-secure-upload.service +++ b/systemd_units/minidump-secure-upload.service @@ -20,8 +20,8 @@ [Unit] Description=MINIDUMP UPLOAD -After=network-online.target tr69hostif.service -Requires=network-online.target +After=network-up.target tr69hostif.service +Requires=network-up.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 0 secure diff --git a/systemd_units/minidump-upload.service b/systemd_units/minidump-upload.service index dcb38dd4..9a2c3516 100644 --- a/systemd_units/minidump-upload.service +++ b/systemd_units/minidump-upload.service @@ -20,8 +20,8 @@ [Unit] Description=MINIDUMP UPLOAD -After=network-online.target -Requires=network-online.target +After=network-up.target +Requires=network-up.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 0 diff --git a/systemd_units/notify-network-ready.service b/systemd_units/notify-network-ready.service deleted file mode 100644 index 8a11c9af..00000000 --- a/systemd_units/notify-network-ready.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Log Internet connectivity and Trigger network target -After=dbus.service - -[Service] -Type=oneshot -ExecStartPre=/bin/touch /tmp/connectivity_check_done -ExecStart=/lib/rdk/logMilestone.sh "INTERNET_FULLY_CONNECTED"