Support postStart scripts in service units
This commit is contained in:
parent
891be375b5
commit
13d747c11a
@ -122,6 +122,15 @@ with pkgs.lib;
|
||||
'';
|
||||
};
|
||||
|
||||
postStart = mkOption {
|
||||
type = types.string;
|
||||
default = "";
|
||||
description = ''
|
||||
Shell commands executed after the service's main process
|
||||
is started.
|
||||
'';
|
||||
};
|
||||
|
||||
restartIfChanged = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -229,6 +229,13 @@ let
|
||||
''}
|
||||
''}
|
||||
|
||||
${optionalString (def.postStart != "") ''
|
||||
ExecStartPost=${makeJobScript "${name}-poststart.sh" ''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${def.postStart}
|
||||
''}
|
||||
''}
|
||||
|
||||
${attrsToSection def.serviceConfig}
|
||||
'';
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user