regulators: Add phosphor-regulators service dependencies

'regsctl' can't do anything useful until phosphor-regulators is running,
so add systemd unit dependencies to ensure it's started before
regulators-config and regulators-monitor-{enable,disable}.

While we're at it, change phosphor-regulators.service to be of type dbus
so we get a more meaningful check that it's really up and running, and
tweak the instantiation of ManagerObject so that it emits the necessary
signals.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I724e4f335c4347ad6789e2d68cfb58c6387e6073
diff --git a/phosphor-regulators/src/manager.cpp b/phosphor-regulators/src/manager.cpp
index 5eeccc9..a99ec11 100644
--- a/phosphor-regulators/src/manager.cpp
+++ b/phosphor-regulators/src/manager.cpp
@@ -72,9 +72,10 @@
 const fs::path testConfigFileDir{"/etc/phosphor-regulators"};
 
 Manager::Manager(sdbusplus::bus::bus& bus, const sdeventplus::Event& event) :
-    ManagerObject{bus, managerObjPath, ManagerObject::action::defer_emit},
-    bus{bus}, eventLoop{event}, services{bus},
-    phaseFaultTimer{event, std::bind(&Manager::phaseFaultTimerExpired, this)},
+    ManagerObject{bus, managerObjPath}, bus{bus}, eventLoop{event},
+    services{bus}, phaseFaultTimer{event,
+                                   std::bind(&Manager::phaseFaultTimerExpired,
+                                             this)},
     sensorTimer{event, std::bind(&Manager::sensorTimerExpired, this)}
 {
     // Subscribe to D-Bus interfacesAdded signal from Entity Manager.  This
diff --git a/services/phosphor-regulators-config.service b/services/phosphor-regulators-config.service
index 2193184..3da3cd6 100644
--- a/services/phosphor-regulators-config.service
+++ b/services/phosphor-regulators-config.service
@@ -1,5 +1,7 @@
 [Unit]
 Description=Phosphor Power Regulators Config
+Requires=phosphor-regulators.service
+After=phosphor-regulators.service
 Wants=obmc-power-start-pre@0.target
 Before=obmc-power-start-pre@0.target
 Before=op-power-start@0.service
diff --git a/services/phosphor-regulators-monitor-disable.service b/services/phosphor-regulators-monitor-disable.service
index b6f09ee..cf8e750 100644
--- a/services/phosphor-regulators-monitor-disable.service
+++ b/services/phosphor-regulators-monitor-disable.service
@@ -1,5 +1,7 @@
 [Unit]
 Description=Phosphor Power Regulators Disable Monitoring
+Requires=phosphor-regulators.service
+After=phosphor-regulators.service
 Wants=obmc-host-stop-pre@0.target
 Before=obmc-host-stop-pre@0.target
 Conflicts=phosphor-regulators-monitor-enable.service
diff --git a/services/phosphor-regulators-monitor-enable.service b/services/phosphor-regulators-monitor-enable.service
index 316a628..033ebea 100644
--- a/services/phosphor-regulators-monitor-enable.service
+++ b/services/phosphor-regulators-monitor-enable.service
@@ -1,5 +1,7 @@
 [Unit]
 Description=Phosphor Power Regulators Enable Monitoring
+Requires=phosphor-regulators.service
+After=phosphor-regulators.service
 Wants=obmc-power-on@0.target
 After=obmc-power-on@0.target
 Conflicts=obmc-chassis-poweroff@0.target
diff --git a/services/phosphor-regulators.service b/services/phosphor-regulators.service
index a7680dc..f089df9 100644
--- a/services/phosphor-regulators.service
+++ b/services/phosphor-regulators.service
@@ -4,6 +4,8 @@
 After=obmc-mapper.target
 
 [Service]
+Type=dbus
+BusName=xyz.openbmc_project.Power.Regulators
 Restart=on-failure
 ExecStart=/usr/bin/phosphor-regulators