Improve socket-activated service handling

This patch provides a more generic way of handling socket-activated
services like dropbear. A socket-activated service only has base socket
unit and spawns service unit with instance name on incoming connection,
so the instanced units of it need to be ignored. And whether a service
is socket-activated can be determined by checking the existance of its
service object path.

Tested:
* Two socket-activated service, dropbear and obmc-console-ssh, can be
  controlled as expected.
* Instances of socket-activated services are no loger added to monitor
  list.

Change-Id: If8faa2248e5794a410f804125410608aa69b858d
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
3 files changed
tree: bc290c7f12a26b34b09aabced77b876e39b43ae3
  1. inc/
  2. src/
  3. subprojects/
  4. .clang-format
  5. .gitignore
  6. LICENSE
  7. MAINTAINERS
  8. meson.build
  9. meson_options.txt
  10. OWNERS
  11. README.md
  12. 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.