ensure persistent settings only used on startup

queryAndUpdateProperties() is called in two code paths
- on startup when it is discovering the state of all the services from
  systemd and updating its internal data structures
- when it is issued commands over dbus to change service states

In the first case, the application needs to compare what is reported by
systemd and what it has in its persistent settings and update systemd to
match the persistent settings if there is a mismatch.

In the second case, the application simply needs to ensure the
persistent settings are updated to match what was requested over dbus.

Tested:
- Verified the curl command via Redfish to enable and disable IPMI works
  as expected and the persistent settings matched the dbus values
- Verified that if the persistent settings were changed in the
  filesystem and the service was restarted that the values in the
  persistent settings were used

Change-Id: I0ef7c19c95d32151f8db08a57c9e03f28aa663b1
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2 files changed
tree: 722f5e81ad7094affd0fd9e3d24b4624d6a85b31
  1. inc/
  2. src/
  3. subprojects/
  4. .clang-format
  5. .gitignore
  6. LICENSE
  7. meson.build
  8. meson.options
  9. OWNERS
  10. README.md
  11. srvcfg-manager.service
README.md

Service config manager

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.

Design

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:

  • Determine if the service you want to control is socket activated.
  • To control the Running and Enabled properties of a service:
    • For a service which uses socket activation, control the socket.
    • For other services, control the service unit itself.