move srvcfg-mgr.json file to /var

The srvcfg-mgr.json file is a file that tracks systemd services that the
srvcfg-mgr application monitors and controls. The file is created by the
srvcfg-mgr application on startup. The file is not meant to be modified
by users. Given that this file is not a config file modifiable by users,
move it out of /etc and into /var to better follow other OpenBMC
applications usage of the filesystem. In general, application data goes
under /var, config files which are editable by users/scripts go in /etc.

Future commits in this series will add additional configuration data
files so the goal with this commit is to first get the existing file in
the correct directory so that new files can go there as well.

Note that this is forward compatible in that when you update to code
with this commit in it, your file in /etc will be moved to /var. But if
you were to move backwards after that then the file in /var would not
be moved (the old firmware has no knowledge of it). In this case a new
file would be generated in /etc.

Tested:
- Started up fresh QEMU session, verified file was created in
  /var/lib/service-config-manager/srvcfg-mgr.json and it looked correct
- After above test, stopped srvcfg-mgr.service, moved the file from /var
  to /etc, removed the /var/lib/service-config-manager dir and then
  started up srvcfg-mgr.service. Confirmed file was moved to correct
  location under /var

Change-Id: Ida01ae960f0553bf0f4cf07fe8c3555a4a527e90
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2 files changed
tree: 6ddd4d4c13d935fe203551c0f06e376d0eae0d29
  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.