1# Service Management
2
3## Overview
4
5Applications must use service manager daemon to configure services like
6phosphor-ipmi-net, bmcweb, obmc-console etc in the system, instead of directly
7controlling the same using 'systemd' or 'iptables'. This way client applications
8doesn't need to change to configure services, when the implementations differ.
9The list of services supported are:
10
11- "bmcweb"
12- "obmc-console"`
13- "phosphor-ipmi-kcs"
14- "phosphor-ipmi-net"
15- "obmc-ikvm"
16
17## Implementation Details
18
19Service manager daemon will create D-Bus objects for configurable services in
20the system under the object path `/xyz/openbmc_project/control/service`. For
21each instance of the service there will be a D-Bus object
22`/xyz/openbmc_project/control/service/<service-name>`. For example, if there are
23two instances of `phosphor-ipmi-net` then there will be two D-Bus objects
24`/xyz/openbmc_project/control/service/phosphor_2dipmi_2dnet_40eth0` and
25`/xyz/openbmc_project/control/service/phosphor_2dipmi_2dnet_40eth1`. The D-Bus
26object manages both the associated service and socket unit files. The D-Bus
27object implements the interface
28`xyz.openbmc_project.Control.Service.Attributes`. Network services like bmcweb,
29phosphor-ipmi-net also implements the
30`xyz.openbmc_project.Control.Service.SocketAttributes` interface.
31
32In order to update the property value of a service, `override.conf` file under
33`/etc/systemd/system/<Service unit name>/` is updated and the unit is restarted
34through `org.freedesktop.systemd1`.
35
36### xyz.openbmc_project.Control.Service.Attributes interface
37
38#### properties
39
40- Enabled - indicates whether the service is enabled or disabled, `true`
41  indicates the service will be started on the next boot and `false` indicates
42  that service will not be started on the next boot. This property can be used
43  to change the service behaviour on the next boot, `true` to start the service
44  on the next boot and `false` to not start the service on the next boot. Even
45  if the service is disabled, on the next boot it can be started if there are
46  other service dependencies to satisfy. The service cannot be enabled if the
47  service is masked.
48
49- Masked - indicates whether the service is masked, `true` indicates the service
50  is permanently disabled and `false` indicates the service is enabled. If the
51  property is set to `true`, then the service is permanently disabled and the
52  service is stopped. If the property is set to `false` then the service is
53  enabled and starts running.
54
55- Running - indicates the current state of the service, `true` if the service is
56  running and `false` if the service is not running. This property can be used
57  to change the running state of the service, to start the service set to `true`
58  and to stop the service set to `false`. The service cannot be started if the
59  service is Masked.
60
61### xyz.openbmc_project.Control.Service.SocketAttributes interface
62
63#### properties
64
65- Port - Port number to which the service is configured to listen, if applicable
66  for service. Services like obmc-console will not implement this interface.
67
68## Usage
69
70To permanently disable a service the `Masked` property under the interface
71`xyz.openbmc_project.Control.Service.Attributes` needs to be set to `true` and
72vice versa to enable a service.
73
74RMCP+ port number can be modified from the default port number 623 to a custom
75one by updating the `Port` property value under the interface
76`xyz.openbmc_project.Control.Service.SocketAttributes`.
77