public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Baurzhan Ismagulov <ibr@radix50.net>
To: isar-users@googlegroups.com
Subject: Re: [PATCH] sshd-regen-keys: fix race condition
Date: Mon, 13 Apr 2020 18:22:03 +0200	[thread overview]
Message-ID: <20200413162202.zvkalsae6gxksmn2@yssyq.m.ilbers.de> (raw)
In-Reply-To: <20200312164837.20377-1-Quirin.Gylstorff@siemens.com>

Hello Quirin,

On Thu, Mar 12, 2020 at 05:48:37PM +0100, Q. Gylstorff wrote:
> 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

Could you please help me understand the race you are facing? I've gone through
a couple of scenarios and couldn't identify one.


Apart from that, systemctl(1) says for enable:

"Note that this does not have the effect of also starting any of the units
being enabled. If this is desired, combine this command with the --now switch,
or invoke start with appropriate arguments later."

Similarly, for disable:

"Note that this command does not implicitly stop the units that are being
disabled. If this is desired, either combine this command with the --now
switch, or invoke the stop command with appropriate arguments later."

Considering the following scenario:

1. systemd starts ssh. It reads e.g. one key file but not others.

2. systemd starts sshd-regen-keys.sh. It disables ssh but doesn't stop it, then
   removes the keys.

3. sshd continues reading the other keys.

Is it possible that sshd finds inconsistent set of keys or doesn't find the
other keys? Shouldn't we specify --now for both enable and disable?


With kind regards,
Baurzhan.

  parent reply	other threads:[~2020-04-13 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 16:48 Q. Gylstorff
2020-03-12 17:07 ` cedric_hombourger
2020-04-13 16:22 ` Baurzhan Ismagulov [this message]
2020-04-28  6:22   ` Jan Kiszka
2020-04-29  8:11     ` Gylstorff Quirin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200413162202.zvkalsae6gxksmn2@yssyq.m.ilbers.de \
    --to=ibr@radix50.net \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox