Remove systemd meson configuration variables
This commit removes meson configuration variables which are not actually
configurable and can be hardcoded.
Change-Id: Id9d198bf6562e108b8a7472e770e6d8bb84e2684
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
diff --git a/meson.build b/meson.build
index c48a930..1ea6293 100644
--- a/meson.build
+++ b/meson.build
@@ -45,15 +45,6 @@
conf_data.set_quoted('LDAP_CONF_PERSIST_PATH', '/var/lib/phosphor-ldap-conf',
description : 'path of directory having persisted LDAP configuration enabled property.')
-conf_data.set_quoted('SYSTEMD_BUSNAME', 'org.freedesktop.systemd1',
- description : 'systemd busname.')
-
-conf_data.set_quoted('SYSTEMD_PATH', '/org/freedesktop/systemd1',
- description : 'systemd path')
-
-conf_data.set_quoted('SYSTEMD_INTERFACE', 'org.freedesktop.systemd1.Manager',
- description : 'systemd interface.')
-
conf_header = configure_file(output: 'config.h',
configuration: conf_data)
diff --git a/phosphor-ldap-config/ldap_config_mgr.cpp b/phosphor-ldap-config/ldap_config_mgr.cpp
index eec8579..f0630f6 100644
--- a/phosphor-ldap-config/ldap_config_mgr.cpp
+++ b/phosphor-ldap-config/ldap_config_mgr.cpp
@@ -17,6 +17,10 @@
namespace ldap
{
+constexpr auto systemdBusname = "org.freedesktop.systemd1";
+constexpr auto systemdObjPath = "/org/freedesktop/systemd1";
+constexpr auto systemdInterface = "org.freedesktop.systemd1.Manager";
+
constexpr auto nslcdService = "nslcd.service";
constexpr auto nscdService = "nscd.service";
constexpr auto ldapScheme = "ldap";
@@ -49,8 +53,8 @@
{
try
{
- auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
- SYSTEMD_INTERFACE, "RestartUnit");
+ auto method = bus.new_method_call(systemdBusname, systemdObjPath,
+ systemdInterface, "RestartUnit");
method.append(service.c_str(), "replace");
bus.call_noreply(method);
}
@@ -65,8 +69,8 @@
{
try
{
- auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
- SYSTEMD_INTERFACE, "StopUnit");
+ auto method = bus.new_method_call(systemdBusname, systemdObjPath,
+ systemdInterface, "StopUnit");
method.append(service.c_str(), "replace");
bus.call_noreply(method);
}