systemd module: Add OnFailure to systemd common unit options

This commit is contained in:
Jaka Hudoklin 2015-11-16 15:07:10 +01:00
parent 88f5cfc126
commit b9291616a6
2 changed files with 11 additions and 0 deletions

View File

@ -170,6 +170,15 @@ in rec {
''; '';
}; };
onFailure = mkOption {
default = [];
type = types.listOf types.str;
description = ''
A list of one or more units that are activated when
this unit enters the "failed" state.
'';
};
}; };

View File

@ -199,6 +199,8 @@ let
{ X-Restart-Triggers = toString config.restartTriggers; } { X-Restart-Triggers = toString config.restartTriggers; }
// optionalAttrs (config.description != "") { // optionalAttrs (config.description != "") {
Description = config.description; Description = config.description;
} // optionalAttrs (config.onFailure != []) {
OnFailure = toString config.onFailure;
}; };
}; };
}; };