commit | f2744893b77b9dd8903bb13113f4c3ef62c18f04 | [log] [tgz] |
---|---|---|
author | George Liu <liuxiwei@inspur.com> | Wed Jan 05 17:54:45 2022 +0800 |
committer | George Liu <liuxiwei@inspur.com> | Wed Jan 19 15:38:59 2022 +0800 |
tree | 443289dda30714a8bb9662218c684f98f6e9c4cc | |
parent | cb267c8fc0cdcac68191f4b9dc32ef171f7901e0 [diff] |
Fix loading json file causing coredump If the json file is damaged, when the process is running and deserializing, a coredump will occur and a cereal::RapidJSONException will be thrown. Error message: ``` terminate called after throwing an instance of'cereal::RapidJSONException' what(): rapidjson internal assertion failure: IsObject() ``` Add try-catch to catch the exception, and when the exception occurs, we need to re-serialize the json file and record the log. Tested: Use broken json file and restart the process hosphor-srvcfg-manager[753]: Failed to load json file, need to rewrite, ERROR = rapidjson internal assertion failure: IsObject(), file path = /etc/srvcfg-mgr.json Also, we can seen a bad json file in `/tmp`, like this: /tmp/srvcfg-mgr.json.bad Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I996e9e32f87c25d584a3b5912334d1a137b55b6c
The service config manager provides a D-Bus interface to manage BMC services as described by the service management D-Bus interfaces.
The configuration settings are intended to persist across BMC reboots.
An example use case for this service is BMCWeb's implementation of the Redfish NetworkProtocol schema.
Implementation details are described in the D-Bus interface README.
The service config manager generally makes configuration changes to systemd
units via D-Bus interfaces.
The design pattern to add new services or controls is:
Running
and Enabled
properties of a service: