public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] sshd-regen-keys: fix race condition
@ 2020-03-12 16:48 Q. Gylstorff
  2020-03-12 17:07 ` cedric_hombourger
  2020-04-13 16:22 ` Baurzhan Ismagulov
  0 siblings, 2 replies; 5+ messages in thread
From: Q. Gylstorff @ 2020-03-12 16:48 UTC (permalink / raw)
  To: isar-users, henning.schild, Cedric_Hombourger; +Cc: Quirin Gylstorff

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Systemd waits with starting service until a oneshot is finished this leads
to a race condition if you try to restart a service in a oneshot.

"Behavior of oneshot is similar to simple; however, the service manager will consider
the unit started after the main process exits. It will then start follow-up units.
RemainAfterExit= is particularly useful for this type of service.  Type=oneshot is the
implied default if neither Type= nor ExecStart= are specified."[1]

[1]: man systemd.service

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 .../sshd-regen-keys/files/sshd-regen-keys.service               | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
index a05e1a9..4c4dc0e 100644
--- a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
+++ b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
@@ -7,7 +7,7 @@ Before=shutdown.target sshd.service
 ConditionPathIsReadWrite=/etc
 
 [Service]
-Type=oneshot
+Type=simple
 RemainAfterExit=yes
 Environment=DEBIAN_FRONTEND=noninteractive
 ExecStart=/usr/sbin/sshd-regen-keys.sh
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-29  8:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 16:48 [PATCH] sshd-regen-keys: fix race condition Q. Gylstorff
2020-03-12 17:07 ` cedric_hombourger
2020-04-13 16:22 ` Baurzhan Ismagulov
2020-04-28  6:22   ` Jan Kiszka
2020-04-29  8:11     ` Gylstorff Quirin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox