Various services provided by OBMC will have the need to expose methods to configure, enable, disable and start, stop, reset the service. It is hence desirable for a generic interface which has the above methods in its namespace.
Each of the service will then implement one or more methods of this interface as applicable. If Enable and Start are semantically equivalent to the service, then only one of them may be implemented. Similar is the case with the Disable and Stop methods.
<interface name="org.openbmc.Service"> <method name="Enable"> <arg direction="in" type="a{sv}" name="argv_dict" /> <arg direction="out" type="x" /> </method> <method name="Disable"> <arg direction="in" type="as" name="argv_list" /> <arg direction="out" type="x" /> </method> <method name="Reset"> <arg direction="in" type="" name="" /> <arg direction="out" type="x" /> </method> <method name="Start"> <arg direction="in" type="" name="" /> <arg direction="out" type="x" /> </method> <method name="Stop"> <arg direction="in" type="" name="" /> <arg direction="out" type="x" /> </method> </interface>
Enable (IN a{sv} argv_dict, OUT x return_code);
Configure and Enable the service. Parameters for configuration of the service are provided as a dictionary / map.
An empty dictionary may be passed to re-enable a service post a disable operation.
Disable (IN as argv_list, OUT x return_code);
UnConfigure and Disable the service. Parameters for (un)configuration of the service are provided as a list.
Reset (OUT x return_code);
Reset all the configurable properties of the service to the distribution specific default.
Start (OUT x return_code);
Start the service.
Stop (OUT x return_code);
Stop the service.
A journal/syslog management service (org.openbmc.LogManager) is considered as an example for the purpose of illustration. org.openbmc.Logmanager implements the following interfaces:
org.freedesktop.DBus.Properties org.openbmc.Service org.openbmc.Errl
The log management service can be configured with the IP address and port number of the remote syslog server. When Configured with the above properties and Enabled, journal logs will be streamed as syslog entries to the remote syslog server. When disabled, journal as well as syslog will be logged on the locally. When Enabled again, the previous configuration will be restored and streaming of logs will resume.
Start/Stop/Reset are not implemented by this service.
and Enable it.
busctl call org.openbmc.LogManager /org/openbmc/LogManager org.openbmc.Service Enable a{sv} 2 ipaddr s 9.109.116.67 port u 514
busctl call org.openbmc.LogManager /org/openbmc/LogManager/rsyslog org.openbmc.Service Disable as 0
busctl call org.openbmc.LogManager /org/openbmc/LogManager/rsyslog org.openbmc.Service Enable a{sv} 0
busctl call org.openbmc.LogManager /org/openbmc/LogManager/rsyslog org.freedesktop.DBus.Properties Get ss org.openbmc.Errl ipaddr
busctl call org.openbmc.LogManager /org/openbmc/LogManager/rsyslog org.freedesktop.DBus.Properties Get ss org.openbmc.Errl port
busctl call org.openbmc.LogManager /org/openbmc/LogManager/rsyslog org.freedesktop.DBus.Properties GetAll s org.openbmc.Errl