Skip to content

Conversation

@arithx
Copy link
Contributor

@arithx arithx commented May 18, 2020

Switching the Contents field to the Resource type allows additional
flexibility when specifying unit contents.

This switch comes with the trade-off of no longer being able to
validate unit & dropin contents at validation time.

Closes #884

@arithx arithx force-pushed the systemd_resource branch from 78d5de0 to dc84b44 Compare May 18, 2020 06:25
@arithx
Copy link
Contributor Author

arithx commented May 18, 2020

Code itself isn't tested yet or final, wanted to get this up now to discuss the trade-off (no longer being able to validate unit & dropin contents during validation).

Switching the Contents field to the Resource type allows additional
flexibility when specifying unit contents.
* **name** (string): the name of the unit. This must be suffixed with a valid unit type (e.g. "thing.service"). Every unit must have a unique `name`.
* **_enabled_** (boolean): whether or not the service shall be enabled. When true, the service is enabled. When false, the service is disabled. When omitted, the service is unmodified. In order for this to have any effect, the unit must have an install section.
* **_mask_** (boolean): whether or not the service shall be masked. When true, the service is masked by symlinking it to `/dev/null`.
* **_contents_** (string): the contents of the unit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/string/object/ I think? Also, isn't this a major schema break?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, yeah. This would require us to move to spec 4.0.0. Arguably that's okay -- the change is still translatable, so we can support both 3.x and 4.0 in the same code -- but we've avoided incompatible changes so far. But it also makes the original use case harder to implement in handwritten configs, since they'd need to convert to data URLs.

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

Labels

spec change Requires changes to the spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFE: systemd units able to specify contents:source:data like files section

3 participants