systemk icon indicating copy to clipboard operation
systemk copied to clipboard

feature: support different versions of systemd

Open pires opened this issue 4 years ago • 12 comments

For instance, in RHEL7 (systemd 219), user-mode systemd doesn't seem to be a thing. Also, certain unit attributes we populate today are unsupported, such as:

  • BindReadOnlyPaths
  • PrivateMounts
  • ReadOnlyPaths
  • TemporaryFileSystem

I understand older distros may not be a goal but if we want this project to be used on bigger companies, we'll have to account for this.

pires avatar Jan 21 '21 17:01 pires

I think most of these are not essential, so we can live without if we detect older systemds. The ReadOnly* ones are nice to have though.

OTOH, even I have access to RHEL8 machines...

miekg avatar Jan 22 '21 08:01 miekg

The hard part is to find a feature matrix to determine what attributes are available per version. If we had that, it would be easy to implement this. I need to do some digging because there's demand for RHEL 7 support :)

pires avatar Jan 22 '21 16:01 pires

Even better would be to probe for support, but harder

miekg avatar Jan 22 '21 16:01 miekg

I don't think systemd even does that, does it?

pires avatar Jan 22 '21 16:01 pires

[ Quoting [email protected] in "Re: [virtual-kubelet/systemk] featu..." ]

I don't think systemd even does that, does it?

don't know. You said you got an error, is that detectable from within systemk? We could just barf out dummy units and see what happens

miekg avatar Jan 22 '21 16:01 miekg

I just saw these in journal logs, when parsing the unit, eg

Unknown lvalue 'PrivateMounts' in section 'Service'

pires avatar Jan 22 '21 16:01 pires

[ Quoting [email protected] in "Re: [virtual-kubelet/systemk] featu..." ]

I just saw these in journal logs, when parsing the unit, eg

Unknown lvalue 'PrivateUsers' in section 'Service'

ugh, silently drops it #sigh

miekg avatar Jan 22 '21 16:01 miekg

[ Quoting [email protected] in "Re: [virtual-kubelet/systemk] featu..." ]

I just saw these in journal logs, when parsing the unit, eg

Unknown lvalue 'PrivateUsers' in section 'Service'

there is systemd-run which takes a unit as argument, I would assume that actually errors when giving it the wrong thing?

miekg avatar Jan 22 '21 16:01 miekg

[ Quoting [email protected] in "Re: [virtual-kubelet/systemk] featu..." ]

I just saw these in journal logs, when parsing the unit, eg

Unknown lvalue 'PrivateUsers' in section 'Service'

% systemd-run -p PublicTmp=no ls Unknown assignment: PublicTmp=no % echo $? 1

miekg avatar Jan 22 '21 16:01 miekg

If the CLI does it, then maybe there's an API behind it? I'm not supportive of wrapping CLI because that's not a contract I trust in.

pires avatar Jan 22 '21 17:01 pires

Maybe? Doesn't matter for our API as we can swap it later. Getting some means of detecting and making that code easy and elegant is my goal for now

On Fri, 22 Jan 2021, 18:22 Pires, [email protected] wrote:

If the CLI does it, then maybe there's an API behind it? I'm not supportive of wrapping CLI because that's not a contract I trust in.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/virtual-kubelet/systemk/issues/68#issuecomment-765566857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACWIW2DDCXQTHLH2NOZEBDS3GX5LANCNFSM4WNG7KGQ .

miekg avatar Jan 22 '21 19:01 miekg

Regardless how we probe: this is what I had in mind: https://github.com/virtual-kubelet/systemk/pull/74

miekg avatar Jan 23 '21 17:01 miekg