Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,30 @@ 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).

#### [1.5.1](https://github.com/rdkcentral/systemtimemgr/compare/1.5.0...1.5.1)

- RDKEMW-15665 : Handle deepsleep case with chronyd [`#66`](https://github.com/rdkcentral/systemtimemgr/pull/66)
- Merge tag '1.5.0' into develop [`3facedc`](https://github.com/rdkcentral/systemtimemgr/commit/3facedcb74d9b0d0e4d63d0d146dac32d5fc153d)

#### [1.5.0](https://github.com/rdkcentral/systemtimemgr/compare/1.4.0...1.5.0)

> 10 March 2026

- RDKEMW-14726: Implement Chrony runtime selection for Time Sync [`#62`](https://github.com/rdkcentral/systemtimemgr/pull/62)
- 1.5.0 release changelog updates [`be9a8de`](https://github.com/rdkcentral/systemtimemgr/commit/be9a8de06bba9daf7071347031c95421c60b4783)
- Merge tag '1.4.0' into develop [`6583514`](https://github.com/rdkcentral/systemtimemgr/commit/6583514f6a6a7cbb496f06cb86318faf307ddff2)

#### [1.4.0](https://github.com/rdkcentral/systemtimemgr/compare/1.3.0...1.4.0)

> 3 December 2025

- RDKEMW-9619 : NTP Marker name update [`#57`](https://github.com/rdkcentral/systemtimemgr/pull/57)
- RDK-58859 : 64-bit compilation support for systimemanager [`#53`](https://github.com/rdkcentral/systemtimemgr/pull/53)
- Deploy fossid_integration_stateless_diffscan_target_repo action [`#54`](https://github.com/rdkcentral/systemtimemgr/pull/54)
- Deploy cla action [`#28`](https://github.com/rdkcentral/systemtimemgr/pull/28)
- RDK-57622 : [RDK-E] L2 test framework for SystemTime Manger Module Phase 1. [`#52`](https://github.com/rdkcentral/systemtimemgr/pull/52)
- RDKEMW-5185-Improve L1 Coverage for Systemtimemgr [`#51`](https://github.com/rdkcentral/systemtimemgr/pull/51)
- 1.4.0 release changelog updates [`0c372c0`](https://github.com/rdkcentral/systemtimemgr/commit/0c372c0c9eac5bd1720604d7d24eee7a7141815c)
- Update CODEOWNERS [`df604e0`](https://github.com/rdkcentral/systemtimemgr/commit/df604e0743ba77efcb69eddca2292b7bc3410e2f)
- Merge tag '1.3.0' into develop [`9e6063f`](https://github.com/rdkcentral/systemtimemgr/commit/9e6063f336380c4d04bc032cf0e1bd41e6f49910)

Expand Down
39 changes: 37 additions & 2 deletions systimemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ void SysTimeMgr::deepsleepoff()
{
//Reset State Machine
RDK_LOG(RDK_LOG_INFO,LOG_SYSTIME,"[%s:%d]:Deep Sleep is Turned off. Resetting State Machine and restarting ntp service. \n",__FUNCTION__,__LINE__);

std::string message;
{
std::lock_guard<std::recursive_mutex> guard(g_state_mutex);
if (m_timequality == eTIMEQUALILTY_SECURE) {
m_timequality = eTIMEQUALILTY_GOOD;
Expand Down Expand Up @@ -625,10 +628,42 @@ void SysTimeMgr::deepsleepoff()
}

publishStatus(ePUBLISH_DEEP_SLEEP_ON,std::move(message));

}
//Turn on the NTP time sync.

int ret = v_secure_system("/bin/systemctl is-active --quiet systemd-timesyncd.service");
if (ret == 0) {
// timesyncd is running
RDK_LOG(RDK_LOG_INFO,LOG_SYSTIME,"[%s:%d]:systemd-timesyncd is active, restarting service\n",__FUNCTION__,__LINE__);
v_secure_system("/bin/systemctl reset-failed systemd-timesyncd.service");
v_secure_system("/bin/systemctl restart systemd-timesyncd.service");
v_secure_system("/bin/systemctl restart systemd-timesyncd.service");
} else {
// timesyncd not active, check chronyd
ret = v_secure_system("/bin/systemctl is-active --quiet chronyd.service");
if (ret == 0) {
// chronyd is running
RDK_LOG(RDK_LOG_INFO,LOG_SYSTIME,"[%s:%d]:chronyd is active, performing chronyc burst\n",__FUNCTION__,__LINE__);
ret = v_secure_system("/usr/sbin/chronyc burst 3/4");
if (ret != 0) {
RDK_LOG(RDK_LOG_WARN,LOG_SYSTIME,"[%s:%d]:chronyc burst failed with code %d\n",__FUNCTION__,__LINE__, ret);
}
// Wait for chronyd to synchronize with at least 1 source, for up to 20 tries.
RDK_LOG(RDK_LOG_INFO,LOG_SYSTIME,"[%s:%d]:chronyd is active, waiting for source selection\n",__FUNCTION__,__LINE__);
ret = v_secure_system("/usr/sbin/chronyc waitsync 20 0 0 1");
if (ret != 0) {
RDK_LOG(RDK_LOG_ERROR,LOG_SYSTIME,"[%s:%d]:chronyc waitsync failed with code %d\n",__FUNCTION__,__LINE__, ret);
}

RDK_LOG(RDK_LOG_INFO,LOG_SYSTIME,"[%s:%d]:chronyd is active, performing chronyc makestep\n",__FUNCTION__,__LINE__);
ret = v_secure_system("/usr/sbin/chronyc makestep");
if (ret != 0) {
RDK_LOG(RDK_LOG_ERROR,LOG_SYSTIME,"[%s:%d]:chronyc makestep failed with code %d\n",__FUNCTION__,__LINE__, ret);
}
} else {
RDK_LOG(RDK_LOG_WARN,LOG_SYSTIME,"[%s:%d]:Neither systemd-timesyncd nor chronyd is running, skipping time sync actions.\n",__FUNCTION__,__LINE__);
}
}

}

void SysTimeMgr::deepsleepon()
Expand Down
Loading