openbmc / phosphor-time-manager

Local time policy and emulated host RTC manager
Apache License 2.0
6 stars 10 forks source link

Introduction

phosphor-time-manager is the time manager service that implements D-Bus interface xyz/openbmc_project/Time/EpochTime.interface.yaml. The user can get or set the BMC's time via this interface.

Configuration

phosphor-time-manager is configured by setting -D flags that correspond to options in phosphor-time-manager/meson.options. The option names become C++ preprocessor symbols that control which code is compiled into the program.

General usage

The service xyz.openbmc_project.Time.Manager provides an object on D-Bus:

where each object implements interface xyz.openbmc_project.Time.EpochTime.

The user can directly get or set the property Elapsed of the objects to get or set the time. For example on an authenticated session:

Time settings

Getting BMC time is always allowed, but setting the time may not be allowed depending on the below two settings in the settings manager.

A summary of which cases the time can be set on BMC or HOST:

Mode Set BMC Time
NTP Fail to set
MANUAL OK

Special note on changing NTP setting

Starting from OpenBMC 2.6 (with systemd v239), systemd's timedated introduces a new beahvior that it checks the NTP services' status during setting time, instead of checking the NTP setting:

In OpenBMC 2.4 (with systemd v236), the above will always succeed.

This results in openbmc/openbmc#3459, and the related test cases are updated to cooperate with this behavior change.