From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users@googlegroups.com,
Quirin Gylstorff <quirin.gylstorff@siemens.com>,
Baurzhan Ismagulov <ibr@ilbers.de>
Subject: Re: [PATCH] sshd-regen-keys: fix race condition
Date: Tue, 28 Apr 2020 08:22:53 +0200 [thread overview]
Message-ID: <82ef1e5c-42c6-8a53-b3d3-cbb3fa6a977b@siemens.com> (raw)
In-Reply-To: <20200413162202.zvkalsae6gxksmn2@yssyq.m.ilbers.de>
On 13.04.20 18:22, Baurzhan Ismagulov wrote:
> 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.
>
Quirin, I think this is still open, and - being about to create another
one-shot service - I was wondering whether we need to fix more services.
Baurzhan, please fix your client settings so that you always preserve CC
lists when replying.
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2020-04-28 6: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
2020-04-28 6:22 ` Jan Kiszka [this message]
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=82ef1e5c-42c6-8a53-b3d3-cbb3fa6a977b@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=ibr@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=quirin.gylstorff@siemens.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