xref: /openbmc/phosphor-dbus-interfaces/yaml/xyz/openbmc_project/Control/Service/README.md (revision edb3eead5a674aecaf031369d1b3b35915979ca6)
1b1b4d261SWilliam A. Kennington III# Service Management
2b1b4d261SWilliam A. Kennington III
3b1b4d261SWilliam A. Kennington III## Overview
4388b58f9SPatrick Williams
5b1b4d261SWilliam A. Kennington IIIApplications must use service manager daemon to configure services like
6b1b4d261SWilliam A. Kennington IIIphosphor-ipmi-net, bmcweb, obmc-console etc in the system, instead of directly
7a1347418SPatrick Williamscontrolling the same using 'systemd' or 'iptables'. This way client applications
8a1347418SPatrick Williamsdoesn't need to change to configure services, when the implementations differ.
9a1347418SPatrick WilliamsThe list of services supported are:
10388b58f9SPatrick Williams
11388b58f9SPatrick Williams- "bmcweb"
12388b58f9SPatrick Williams- "obmc-console"`
13388b58f9SPatrick Williams- "phosphor-ipmi-kcs"
14388b58f9SPatrick Williams- "phosphor-ipmi-net"
15*edb3eeadSMohammed Javith Akthar M- "obmc-ikvm"
16b1b4d261SWilliam A. Kennington III
17b1b4d261SWilliam A. Kennington III## Implementation Details
18b1b4d261SWilliam A. Kennington III
19a1347418SPatrick WilliamsService manager daemon will create D-Bus objects for configurable services in
20a1347418SPatrick Williamsthe system under the object path `/xyz/openbmc_project/control/service`. For
21b1b4d261SWilliam A. Kennington IIIeach instance of the service there will be a D-Bus object
22a1347418SPatrick Williams`/xyz/openbmc_project/control/service/<service-name>`. For example, if there are
23a1347418SPatrick Williamstwo instances of `phosphor-ipmi-net` then there will be two D-Bus objects
24a1347418SPatrick Williams`/xyz/openbmc_project/control/service/phosphor_2dipmi_2dnet_40eth0` and
25a1347418SPatrick Williams`/xyz/openbmc_project/control/service/phosphor_2dipmi_2dnet_40eth1`. The D-Bus
26a1347418SPatrick Williamsobject manages both the associated service and socket unit files. The D-Bus
27a1347418SPatrick Williamsobject implements the interface
28b1b4d261SWilliam A. Kennington III`xyz.openbmc_project.Control.Service.Attributes`. Network services like bmcweb,
29b1b4d261SWilliam A. Kennington IIIphosphor-ipmi-net also implements the
30b1b4d261SWilliam A. Kennington III`xyz.openbmc_project.Control.Service.SocketAttributes` interface.
31b1b4d261SWilliam A. Kennington III
32b1b4d261SWilliam A. Kennington IIIIn order to update the property value of a service, `override.conf` file under
33b1b4d261SWilliam A. Kennington III`/etc/systemd/system/<Service unit name>/` is updated and the unit is restarted
34b1b4d261SWilliam A. Kennington IIIthrough `org.freedesktop.systemd1`.
35b1b4d261SWilliam A. Kennington III
36388b58f9SPatrick Williams### xyz.openbmc_project.Control.Service.Attributes interface
37b1b4d261SWilliam A. Kennington III
38388b58f9SPatrick Williams#### properties
39388b58f9SPatrick Williams
40388b58f9SPatrick Williams- Enabled - indicates whether the service is enabled or disabled, `true`
41388b58f9SPatrick Williams  indicates the service will be started on the next boot and `false` indicates
42388b58f9SPatrick Williams  that service will not be started on the next boot. This property can be used
43388b58f9SPatrick Williams  to change the service behaviour on the next boot, `true` to start the service
44388b58f9SPatrick Williams  on the next boot and `false` to not start the service on the next boot. Even
45388b58f9SPatrick Williams  if the service is disabled, on the next boot it can be started if there are
4600233a2fSNodeMan97  other service dependencies to satisfy. The service cannot be enabled if the
47b1b4d261SWilliam A. Kennington III  service is masked.
48b1b4d261SWilliam A. Kennington III
49a1347418SPatrick Williams- Masked - indicates whether the service is masked, `true` indicates the service
50a1347418SPatrick Williams  is permanently disabled and `false` indicates the service is enabled. If the
51a1347418SPatrick Williams  property is set to `true`, then the service is permanently disabled and the
52a1347418SPatrick Williams  service is stopped. If the property is set to `false` then the service is
53a1347418SPatrick Williams  enabled and starts running.
54b1b4d261SWilliam A. Kennington III
55a1347418SPatrick Williams- Running - indicates the current state of the service, `true` if the service is
56a1347418SPatrick Williams  running and `false` if the service is not running. This property can be used
57a1347418SPatrick Williams  to change the running state of the service, to start the service set to `true`
58a1347418SPatrick Williams  and to stop the service set to `false`. The service cannot be started if the
59a1347418SPatrick Williams  service is Masked.
60b1b4d261SWilliam A. Kennington III
61388b58f9SPatrick Williams### xyz.openbmc_project.Control.Service.SocketAttributes interface
62b1b4d261SWilliam A. Kennington III
63388b58f9SPatrick Williams#### properties
64388b58f9SPatrick Williams
65a1347418SPatrick Williams- Port - Port number to which the service is configured to listen, if applicable
66a1347418SPatrick Williams  for service. Services like obmc-console will not implement this interface.
67b1b4d261SWilliam A. Kennington III
68b1b4d261SWilliam A. Kennington III## Usage
69b1b4d261SWilliam A. Kennington III
70b1b4d261SWilliam A. Kennington IIITo permanently disable a service the `Masked` property under the interface
71b1b4d261SWilliam A. Kennington III`xyz.openbmc_project.Control.Service.Attributes` needs to be set to `true` and
72b1b4d261SWilliam A. Kennington IIIvice versa to enable a service.
73b1b4d261SWilliam A. Kennington III
74b1b4d261SWilliam A. Kennington IIIRMCP+ port number can be modified from the default port number 623 to a custom
75b1b4d261SWilliam A. Kennington IIIone by updating the `Port` property value under the interface
76b1b4d261SWilliam A. Kennington III`xyz.openbmc_project.Control.Service.SocketAttributes`.
77