From dc8ce7de51a44a56ecf846ae8563d43a42d9743c Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 25 Sep 2025 08:58:51 +0000 Subject: [PATCH] RDKEMW-8559 : Remove Box reboot counter reset services --- lib/rdk/reboot-count-checker.sh | 113 ------------------------- systemd_units/reboot-counter.service | 40 --------- systemd_units/reboot-counter.timer | 28 ------ systemd_units/reboot-notifier@.service | 28 ------ 4 files changed, 209 deletions(-) delete mode 100755 lib/rdk/reboot-count-checker.sh delete mode 100644 systemd_units/reboot-counter.service delete mode 100644 systemd_units/reboot-counter.timer delete mode 100644 systemd_units/reboot-notifier@.service diff --git a/lib/rdk/reboot-count-checker.sh b/lib/rdk/reboot-count-checker.sh deleted file mode 100755 index 2ab72719..00000000 --- a/lib/rdk/reboot-count-checker.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -############################################################################## -# If not stated otherwise in this file or this component's LICENSE file the -# following copyright and licenses apply: -# -# Copyright 2020 RDK Management -# -# 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. -############################################################################## - -if [ -f /etc/include.properties ];then - . /etc/include.properties -else - echo "Missing Generic Property file.." -fi - -if [ -f /etc/device.properties ];then - . /etc/device.properties -else - echo "Missing Device Property file.." -fi - -if [ -f /lib/rdk/t2Shared_api.sh ]; then - source /lib/rdk/t2Shared_api.sh -fi - -service=$1 -extn="_restart_count" - -rebootCounterCheck() -{ - process=$1 - logFile=$2 - if [ ! -f /opt/.$process$extn ];then - count=1 - echo 1 > /opt/.$process$extn - else - count=`cat /opt/.$process$extn` - count=`expr $count + 1` - echo $count > /opt/.$process$extn - fi - if [ $count -gt 10 ];then - echo "`/bin/timestamp` -----Box has rebooted 10 times.. no more reboot----" >> $logFile - t2CountNotify "SYST_ERR_MaxReboots" - else - count=1 - while [ $count -lt 8 ] - do - count=`expr $count + 1` - sleep 5 - if [ ! -d /tmp/.uploadCoredumps.lock.d ] && [ ! -d /tmp/.uploadMinidumps.lock.d ];then - count=8 - fi - done - # adding a sleep to ensure the log sync - sleep 5 - x=0 - while [ ! -f /tmp/coredump_mutex_release ] - do - x=`expr $x + 1` - sleep 1 - if [ $x -eq 10 ];then break; fi - done - #update dependency failure - systemctl -l status -n 25 $1 | grep -i "Dependency failed" - if [ 0 -eq $? ];then - /rebootNow.sh -s $3 -o "due to service dependency failure" - else - # -c to indicate crash - /rebootNow.sh -c $3 - fi - fi -} - -if [ "$service" ];then - case $service in - "rmfstreamer") - touch /opt/.upload_on_startup - if [ "$DEVICE_TYPE" != "mediaclient" ];then - rebootCounterCheck rmfstreamer $LOG_PATH/ocapri_log.txt "rmfStreamer" - else - echo "`/bin/timestamp` Restart of service needed here..!" >> $LOG_PATH/rmfstr_log.txt - fi - ;; - "runpod") - touch /opt/.upload_on_startup - rebootCounterCheck runpod $LOG_PATH/ocapri_log.txt "runPod" - ;; - "iarmbusd") - rebootCounterCheck iarmbusd $LOG_PATH/uimgr_log.txt "IARMDaemonMain" - ;; - "dsmgr") - rebootCounterCheck dsmgr $LOG_PATH/uimgr_log.txt "dsMgrMain" - ;; - *) - echo "`/bin/timestamp` Unknown Argument: $service" >> /opt/logs/rebootInfo.log - echo "`/bin/timestamp` Unknown Service not in the reboot list" >> /opt/logs/rebootInfo.log - ;; - esac -else - echo "Unknown Argument: $0 $service" - exit 0 -fi diff --git a/systemd_units/reboot-counter.service b/systemd_units/reboot-counter.service deleted file mode 100644 index bc6068c1..00000000 --- a/systemd_units/reboot-counter.service +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# If not stated otherwise in this file or this component's LICENSE file the -# following copyright and licenses apply: -# -# Copyright 2020 RDK Management -# -# 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. -############################################################################## - -[Unit] -Description=Reboot Counter Reset Service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/sh -c ' if [ -f /opt/.rmfstreamer_restart_count ];then \ - echo "Deleting /opt/.rmfstreamer_restart_count " ; \ - rm -rf /opt/.rmfstreamer_restart_count ; fi' -ExecStart=/bin/sh -c ' if [ -f /opt/.runpod_restart_count ];then \ - echo "Deleting /opt/.runpod_restart_count " ; \ - rm -rf /opt/.runpod_restart_count ; fi' -ExecStart=/bin/sh -c ' if [ -f /opt/.iarmbusd_restart_count ];then \ - echo "Deleting /opt/.iarmbusd_restart_count " ; \ - rm -rf /opt/.iarmbusd_restart_count ; fi' -ExecStart=/bin/sh -c ' if [ -f /opt/.dsmgr_restart_count ];then \ - echo "Deleting /opt/.dsmgr_restart_count " ; \ - rm -rf /opt/.dsmgr_restart_count ; fi' - - - diff --git a/systemd_units/reboot-counter.timer b/systemd_units/reboot-counter.timer deleted file mode 100644 index 83f78d00..00000000 --- a/systemd_units/reboot-counter.timer +++ /dev/null @@ -1,28 +0,0 @@ -############################################################################## -# If not stated otherwise in this file or this component's LICENSE file the -# following copyright and licenses apply: -# -# Copyright 2020 RDK Management -# -# 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. -############################################################################## - -[Unit] -Description=Reboot Counter Reset - -[Timer] -OnBootSec=30min -Unit=reboot-counter.service - -[Install] -WantedBy=multi-user.target diff --git a/systemd_units/reboot-notifier@.service b/systemd_units/reboot-notifier@.service deleted file mode 100644 index d9e83d26..00000000 --- a/systemd_units/reboot-notifier@.service +++ /dev/null @@ -1,28 +0,0 @@ -############################################################################## -# If not stated otherwise in this file or this component's LICENSE file the -# following copyright and licenses apply: -# -# Copyright 2020 RDK Management -# -# 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. -############################################################################## - -[Unit] -Description=Reboot Logger And Counter -After=local-fs.target - -[Service] -Type=oneshot -ExecStart=/bin/sh -c '/lib/rdk/reboot-checker.sh shutdown %i' -ExecStart=/bin/sh -c '/lib/rdk/reboot-count-checker.sh %i' -