summaryrefslogtreecommitdiff
path: root/meta-phosphor
diff options
context:
space:
mode:
authorJonathan Doman <jonathan.doman@intel.com>2020-12-03 04:55:30 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-12-17 06:07:56 +0300
commitf441dba2f686a182af7014983c3d066fa2115a00 (patch)
treec2fc8ac8d48c0d4f6adcc0f3c4f8047eb08b7f1c /meta-phosphor
parentfb4f9aeefa175165794bd83eade0bfa3b75f3437 (diff)
downloadopenbmc-f441dba2f686a182af7014983c3d066fa2115a00.tar.xz
Make instantiated mapper services oneshot
The systemd issue which prevented use of Restart= policy in oneshot services has been fixed. Therefore, mapper-wait@ and mapper-subtree-remove@ services can be cleaned up and simplified. Tested: 1. Created a simple test.service which has Wants/After dependency on mapper-wait@-some-object.service, and just echos "TEST" to journal. 2. systemctl start test; verify it hangs since object doesn't exist yet 3. Start service which creates /some/object; verify test.service is started. 4. systemctl restart test; verify it starts immediately 5. Stop service which publishes /some/object 6. systemctl restart test; verify it starts immediately, since mapper-wait@-some-object is still active, even though the object is gone. (From meta-phosphor rev: 9f4d038a8ce14c8f6a4ac62e4d0a993b3f9aac1f) Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Change-Id: I97fca5cb4166e4f0f72352140bcef4ba453b99da Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-phosphor')
-rw-r--r--meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service14
-rw-r--r--meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service14
2 files changed, 4 insertions, 24 deletions
diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service
index 4bd411e75..4fad8fad7 100644
--- a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service
+++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service
@@ -4,19 +4,9 @@ Wants=obmc-mapper.target
After=obmc-mapper.target
[Service]
-# We are using a Type=simple service instead of the normal Type=oneshot
-# since Type=oneshot can't have Restart= lines
-# https://github.com/systemd/systemd/issues/2582
-# Unfortunately Type=oneshot services halt any services which order after
-# the oneshot on the completion of ExecStart= lines. For Type=simple, the
-# halting is only until ExecStartPre lines have completed and ExecStart has
-# begun executing. Since we want to wait for the `mapper wait` process to
-# finish, it must be an ExecStartPre. All Type=simple services require an
-# ExecStart so we use `true` as a placeholder to satisfy the requirement.
-Type=simple
+Type=oneshot
RemainAfterExit=no
Restart=on-failure
TimeoutStartSec=infinity
-ExecStartPre=/usr/bin/env mapper subtree-remove %I
-ExecStart=/usr/bin/env true
+ExecStart=/usr/bin/env mapper subtree-remove %I
SyslogIdentifier=mapper
diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service
index f7744e2d8..d61309097 100644
--- a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service
+++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service
@@ -4,19 +4,9 @@ Wants=obmc-mapper.target
After=obmc-mapper.target
[Service]
-# We are using a Type=simple service instead of the normal Type=oneshot
-# since Type=oneshot can't have Restart= lines
-# https://github.com/systemd/systemd/issues/2582
-# Unfortunately Type=oneshot services halt any services which order after
-# the oneshot on the completion of ExecStart= lines. For Type=simple, the
-# halting is only until ExecStartPre lines have completed and ExecStart has
-# begun executing. Since we want to wait for the `mapper wait` process to
-# finish, it must be an ExecStartPre. All Type=simple services require an
-# ExecStart so we use `true` as a placeholder to satisfy the requirement.
-Type=simple
+Type=oneshot
RemainAfterExit=yes
Restart=on-failure
TimeoutStartSec=infinity
-ExecStartPre=/usr/bin/env mapper wait %I
-ExecStart=/usr/bin/env true
+ExecStart=/usr/bin/env mapper wait %I
SyslogIdentifier=mapper