Maintenance Manager is one of the WPEFramework Thunder Plugin that manages the daily maintenance activities on RDK device.
| Daily Maintenance | Set of Activities (or tasks) that needs to be executed daily without impacting the UX. Executed when the user is not actively using the CPE |
|---|---|
| Maintenance Activity | Activity (or Task) that is a part of Daily Maintenance. They are considered critical and wake up the Device from DEEPSLEEP power state to be executed |
| DCM | Device Configuration Manager, it fetches and updates configuration for Device |
| RFC | RDK Runtime Feature Control, is used for remotely controlling CPE software features on RDK platforms. Release Management uses RFC for staged rollout of new features. |
| Log Upload | Uploads all the logs at the time specified in DCMSettings.conf or when the size reaches predefined limit |
| FW Download (swupdate/ rdkfwupgrader) | Checkis if there is a new firmware update is required and performing the update on the device (if needed) |
Also known as Maintenance on Bootup. RDK automatically performs a Maintenance as soon as the device boots up. Unsolicited maintenance occurs on each and every bootup. Device will look for critical updates on boot and performs maintenance of critical activities without application triggering maintenance. The isRebootPending will be set to false unless there is an RFC/FWUpdate needed. Below are the tasks executed as part of unsolicited maintenance.
...
WhoAmI is used by device to determine the operating context (partner, product/experience, Regional configService) and load the right firmware so that we can activate and use the service that user signed up for. It happens only in Unsolicited Maintenance. It is not defaulted in RDKE yet (as of 25Q2). WhoAmI has dependency on components such as AuthService which has to be refactored before making it suitable for community builds usage.
| Activity/ Task Name | RDKV | RDKE | ||
|---|---|---|---|---|
| Wrapper | Task | Wrapper | Task | |
| RFC | /lib/rdk/Start_RFC.sh | /lib/rdk/RFCbase.sh | /lib/rdk/StartMaintenanceTasks.sh RFC | ENABLE_RFC_MANAGER flag Enabled |
/usr/bin/rfcMgr | ||||
| ENABLE_RFC_MANAGER flag Disbled | ||||
/lib/rdk/RFCbase.sh | ||||
| SWUPDATE | /lib/rdk/swupdate_utility.sh | FWDOWNLOAD RFC Enabled | /lib/rdk/StartMaintenanceTasks.sh SWUPDATE | /usr/bin/rdkvfwupgrader 0 1 |
/usr/bin/rdkvfwupgrader 0 1 | ||||
| FWDOWNLOAD RFC Disabled | ||||
/lib/rdk/deviceInitiatedFWDnld.sh | ||||
| LOGUPLOAD | /lib/rdk/Start_uploadSTBLogs.sh | /lib/rdk/uploadSTBLogs.sh | /lib/rdk/StartMaintenanceTasks.sh LOGUPLOAD | /lib/rdk/uploadSTBLogs.sh |
The DCMScript.sh (in RDKV) or dcmd (in RDKE) will parse the /tmp/DCMSettings.conf file to get XConf Data fetched by Telemetry. Data likeurn:settings:CheckSchedule:cron is used to get start_hr and start_min values and urn:settings:TimeZoneMode is used to get the tz_mode data. Device is expected to receive the time based on the time zone confiigured in the device. This parsed data is then stored to /opt/rdk_maintenance.conf file by DCM. The data can be used to calculate the Maintenance Start Time for the next scheduled Maintenance (SOLICITED). The Maintenance Start Time is calculated using /lib/rdk/getMaintenanceStartTime.sh (in RDKV) or using CalculateStartTime() API in MaintenanceManager internally.
| PlantUML Macro | ||
|---|---|---|
| ||
@startuml
start
:Initialize();
:InitializeIARM();
:MAINTENANCE_IDLE;
if (isDeviceConnectedToInternet?) then (yes)
else (Not Connected)
repeat
:Sleep 30s;
repeat while (Retry Count < 4)
endif
if (Network Plugin Active?) then (yes)
:Subscribe to Internet Status Event;
else (no)
:Internet Status Event Subscription Failed;
endif
:task_execution_thread;
if (isDeviceOnline?) then (yes)
else (no)
:MAINTENANCE_ERROR;
stop
endif
group Task Execution (RFC/ SWUPDATE/ LOGUPLOAD)
:Start RFC/ SWUPDATE/ LOGUPLOAD Task;
:Start Timer;
repeat
:Execute system() for RFC/ SWUPDATE/ LOGUPLOAD Task;
if (RFC/ SWUPDATE/ LOGUPLOAD success? before timer ends) then (yes)
:Stop Timer;
:MAINTENANCE_<RFC/FWDOWNLOAD/LOGUPLOAD>_COMPLETE;
else (no, fail or timeout)
if (System Call Failed) then (yes)
if (Retry Count < TASK_RETRY_COUNT) then (yes)
:Retry after TASK_RETRY_DELAY;
:Decrement Retry Count;
:Restart Timer;
else (no more retries)
:MAINTENANCE_<RFC/FWDOWNLOAD/LOGUPLOAD>_ERROR;
:Stop Timer;
break
endif
else (RFC/ SWUPDATE/ LOGUPLOAD Task Timed Out)
:MAINTENANCE_<RFC/FWDOWNLOAD/LOGUPLOAD>_ERROR;
:Stop Timer;
break
endif
endif
repeat while (Retry Count > 0)
end group
if (Any at least One Task of RFC/ FWDOWNLOAD/ LOGUPLOAD failed) then (yes)
:MAINTENANCE_ERROR;
else (no)
:MAINTENANCE_COMPLETE;
endif
:Task Execution Completed;
:Thread Join;
:Deinitialize();
if (Timer Exists) then (yes)
:Delete Timer;
if (Signal Registered) then (yes)
:Unregister Signal;
endif
endif
stop
@enduml |
|
Maintenance Manager logs can be found in wpeframework log.
Grep string: grep -inr "MaintenanceManager.cpp" /opt/logs/maintenance.log*