Skip to content

Commit ea304a3

Browse files
authored
RDKB-63415 : Move SelfHeal Scripts to Cron (#229)
RDKB-63415 : Move SelfHeal Scripts to Cron Reason for change: Running the Selfheal scripts as cron jobs instead of background processes when the cron is enabled and running as normal background process when the cron is disabled. Test Procedure: Check scripts are running in crontab when the cron is enabled. Risks: Low Priority: P0 --------- Signed-off-by: aj970 <akshaya_j@comcast.com>
1 parent 88b1d0d commit ea304a3

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

source/scripts/init/defaults/system_defaults_arm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,5 +1497,7 @@ $FwDwld_AvlMem_RsrvThreshold=20
14971497
#FwDwld_ImageProcMemPercent Default value
14981498
$FwDwld_ImageProcMemPercent=0
14991499

1500+
#SelfHeal Cron - RFC flag is enabled by default
1501+
$SelfHealCronEnable=true
15001502
#STAGE Default value
15011503
$StageEnabled=false

source/scripts/init/defaults/system_defaults_bci

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,5 +1347,7 @@ $FwDwld_AvlMem_RsrvThreshold=20
13471347
#FwDwld_ImageProcMemPercent Default value
13481348
$FwDwld_ImageProcMemPercent=0
13491349

1350+
#SelfHeal Cron - RFC flag is enabled by default
1351+
$SelfHealCronEnable=true
13501352
#STAGE Default value
13511353
$StageEnabled=false

source/scripts/init/service.d/service_crond.sh

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,44 @@ service_start ()
167167
# Don't Zero iptable Counter
168168
echo "58 * * * * /usr/bin/GenFWLog -nz" >> $CRONTAB_FILE
169169

170-
# Monitor syscfg DB every 15minutes
171-
echo "*/15 * * * * /usr/ccsp/tad/syscfg_recover.sh" >> $CRONTAB_FILE
170+
SELFHEAL_CRON_ENABLE=$(syscfg get SelfHealCronEnable)
171+
SELFHEAL_ENABLE=$(syscfg get selfheal_enable)
172+
if [ "$SELFHEAL_CRON_ENABLE" = "true" ] && [ "$SELFHEAL_ENABLE" = "true" ]; then
173+
echo_t "SelfHeal Cron is enabled"
174+
# Monitor selfheal_aggressive.sh based on syscfg value
175+
AGGRESSIVE_INTERVAL=$(syscfg get AggressiveInterval)
176+
if [ -z "$AGGRESSIVE_INTERVAL" ]; then
177+
AGGRESSIVE_INTERVAL=5
178+
fi
179+
#Write cron rule
180+
echo "*/$AGGRESSIVE_INTERVAL * * * * /usr/ccsp/tad/selfheal_aggressive.sh" >> $CRONTAB_FILE
181+
182+
# Monitor resource_monitor.sh based on syscfg value
183+
RESOURCE_MONITOR_INTERVAL=$(syscfg get resource_monitor_interval)
184+
if [ -z "$RESOURCE_MONITOR_INTERVAL" ]; then
185+
RESOURCE_MONITOR_INTERVAL=15
186+
fi
187+
echo "*/$RESOURCE_MONITOR_INTERVAL * * * * /usr/ccsp/tad/resource_monitor.sh" >> $CRONTAB_FILE
188+
189+
# Monitor self_heal_connectivity_test.sh based on syscfg value
190+
SELFHEAL_PING_INTERVAL=$(syscfg get ConnTest_PingInterval)
191+
if [ -z "$SELFHEAL_PING_INTERVAL" ]; then
192+
SELFHEAL_PING_INTERVAL=60
193+
fi
194+
echo "*/$SELFHEAL_PING_INTERVAL * * * * /usr/ccsp/tad/self_heal_connectivity_test.sh" >> $CRONTAB_FILE
195+
echo_t "Selfheal cron jobs are started"
196+
197+
else
198+
echo_t "Selfheal cron is disabled"
199+
# Monitor syscfg DB every 15minutes
200+
echo "*/15 * * * * /usr/ccsp/tad/syscfg_recover.sh" >> $CRONTAB_FILE
172201

173202
# Monitor resource_monitor.sh every 5 minutes TCCBR-3288
174203
# if [ "$BOX_TYPE" = "TCCBR" ]; then
175204
echo "*/5 * * * * /usr/ccsp/tad/resource_monitor_recover.sh" >> $CRONTAB_FILE
176205
# fi
206+
207+
fi
177208

178209
# RDKB-23651
179210
if [ "$THERMALCTRL_ENABLE" = "true" ]; then

0 commit comments

Comments
 (0)