Add mapper client service template
Use mapper-wait in Wants or Requires to defer startup of DBus
services until an object exists on the DBus somewhere.
Change-Id: I9bb5fe8280d842198064f2b43a9aa72731303ba8
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper.bb b/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper.bb
index b516f68..26e805e 100644
--- a/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper.bb
+++ b/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper.bb
@@ -12,6 +12,7 @@
DEPENDS += "systemd"
DBUS_SERVICE_${PN} += "org.openbmc.ObjectMapper.service"
+SYSTEMD_SERVICE_${PN} = "mapper-wait@.service"
RDEPENDS_${PN} += " \
python-xml \
python-dbus \
diff --git a/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper/mapper-wait@.service b/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper/mapper-wait@.service
new file mode 100644
index 0000000..d919091
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/dbus/obmc-mapper/mapper-wait@.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Wait for %I
+Wants=obmc-mapper.target
+After=obmc-mapper.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+Restart=no
+ExecStart={sbindir}/mapper wait %I