mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
Support postStart scripts in service units
This commit is contained in:
parent
891be375b5
commit
13d747c11a
2 changed files with 16 additions and 0 deletions
|
@ -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 {
|
restartIfChanged = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
|
|
@ -229,6 +229,13 @@ let
|
||||||
''}
|
''}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
${optionalString (def.postStart != "") ''
|
||||||
|
ExecStartPost=${makeJobScript "${name}-poststart.sh" ''
|
||||||
|
#! ${pkgs.stdenv.shell} -e
|
||||||
|
${def.postStart}
|
||||||
|
''}
|
||||||
|
''}
|
||||||
|
|
||||||
${attrsToSection def.serviceConfig}
|
${attrsToSection def.serviceConfig}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue