Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncm-systemd: Why is Environment modelled as a list of dicts? #1564

Open
jrha opened this issue Dec 9, 2022 · 1 comment
Open

ncm-systemd: Why is Environment modelled as a list of dicts? #1564

jrha opened this issue Dec 9, 2022 · 1 comment
Labels

Comments

@jrha
Copy link
Member

jrha commented Dec 9, 2022

It is very confusing and we haven't documented it well.

I realise that upstream systemd supports multiple lines of assignments to allow later lines to override earlier ones, but does anyone actually have a use case for this? If so why can't it done at compile time?

Right now we just end up with lots of:

'/software/components/systemd/unit/{foo.service}/file/config/service/Environment/0/NODE_ENV' = 'production';

and

'Environment' = list(
    dict('CONFIG', '/etc/foo/bar.cfg'),
    dict('PIDFILE', '/run/foo-bar.pid'),
),

Which depending on ordering blows away configurtation and doesn't really help make code maintainable, as opposed to:

prefix '/software/components/systemd/unit/{foo.service}/file/config/service/Environment';
'NODE_ENV' = 'production';
'CONFIG' = '/etc/foo/bar.cfg';
'PIDFILE' = '/run/foo-bar.pid';
@jrha jrha added the question label Dec 9, 2022
@stdweird
Copy link
Member

stdweird commented Dec 9, 2022

the component was modelled after the capabilities of systemd. i don't think we ever used it either (would have to doublecheck)

it might be better to introduce some special key like {-} to indictate the start from empty line and handle it in the component for sure.

fyi, can't you use `prefix '/software/components/systemd/unit/{foo.service}/file/config/service/Environment/0' for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants