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