Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions lib/rdk/rebootNow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,18 @@ rebootLog "End of the sync"

rebootLog "Creating $REBOOTNOW_FLAG as the reboot was triggred by RDK software"
touch $REBOOTNOW_FLAG
rebootLog "Rebooting the Device Now"
rm -rf $pid_file
reboot

sleep 15
rebootLog "Rebooting the Device Now"
reboot &
REBOOT_PID=$!

rebootLog "System still running after reboot command, Reboot Failed..."
rebootLog "Invoking Systemctl Reboot After First Reboot Attempt Failure"
sleep 90
rebootLog "System still running after reboot command, Reboot Failed for $REBOOT_PID..."
systemctl reboot
if [ $? -eq 1 ]; then
rebootLog "Reboot failed due to systemctl hang or connection timeout, trying force reboot..."
if [ -f /tmp/systemd_freeze_reboot_on ]; then
rebootLog "Force Reboot due to systemd freeze detection"
else
rebootLog "Force Reboot after systemd reboot failure"
fi
reboot -f
fi
rebootLog "Reboot failed due to systemctl hang or connection timeout"
fi
kill $REBOOT_PID 2>/dev/null
rebootLog "Triggering force Reboot after standard soft reboot failure"
reboot -f