Add mapper-wait-until-removed service

Change-Id: Ib7d2c64d604ef5f8ffb65f320a034039cebcff1e
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/common/recipes-phosphor/dbus/phosphor-mapper.bb b/common/recipes-phosphor/dbus/phosphor-mapper.bb
index 9fcd1b9..e3bfbf1 100644
--- a/common/recipes-phosphor/dbus/phosphor-mapper.bb
+++ b/common/recipes-phosphor/dbus/phosphor-mapper.bb
@@ -14,7 +14,7 @@
 DEPENDS += "autoconf-archive-native"
 
 DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service"
-SYSTEMD_SERVICE_${PN} = "mapper-wait@.service"
+SYSTEMD_SERVICE_${PN} = "mapper-wait@.service mapper-wait-until-removed@.service"
 RDEPENDS_libmapper += "libsystemd"
 RDEPENDS_${PN} += " \
         python-xml \
diff --git a/common/recipes-phosphor/dbus/phosphor-mapper/mapper-wait-until-removed@.service b/common/recipes-phosphor/dbus/phosphor-mapper/mapper-wait-until-removed@.service
new file mode 100644
index 0000000..1dd0124
--- /dev/null
+++ b/common/recipes-phosphor/dbus/phosphor-mapper/mapper-wait-until-removed@.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Wait for %I to be removed
+Wants=obmc-mapper.target
+After=obmc-mapper.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+Restart=no
+ExecStart={sbindir}/mapper wait-until-removed %I