Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

systemd: check service.name.Type and service.name.Restart #122

Conversation

MarcWeber
Copy link
Contributor

No description provided.

let val = getAttr name attr;
in optional ( hasAttr name attr && !elem val values) "${name} ${val} not known to systemd";
checkType = assertValueOneOf "Type" ["simple" "forking" "oneshot" "dbus" "notify" "idle"];
checkRestart = assertValueOneOf "Restart" ["no" "on-success" "on-failure" "on-abort" "always"];
Copy link
Member

Choose a reason for hiding this comment

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

This sounds to me that we should make a type of of this and enable the syntax:

type = types.attrsOf {
Type = types.anyOf ["simple" "forking" …];
Restart = types.anyOf ["no" "on-success" …];
};

what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keep in mind that you may want to check both: mandatory and optional names. That's why mkOption would be a bad option here. Except that types.attrsOf sounds like a good idea - if its documented properly :)

@Phreedom
Copy link
Member

Phreedom commented May 5, 2013

Any objections to merging the original proposal for now?

@ghost ghost assigned Phreedom May 5, 2013
@Phreedom
Copy link
Member

cherry-picked to avoid ugly branch mess: d97ea69

@Phreedom Phreedom closed this Aug 15, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants