Add support for postStop scripts
This commit is contained in:
parent
e9b221c2ff
commit
62b707de07
@ -145,6 +145,15 @@ rec {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
postStop = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Shell commands executed after the service's main process
|
||||||
|
has exited.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
restartIfChanged = mkOption {
|
restartIfChanged = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -250,6 +250,13 @@ let
|
|||||||
''}
|
''}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
${optionalString (def.postStop != "") ''
|
||||||
|
ExecStopPost=${makeJobScript "${name}-poststop.sh" ''
|
||||||
|
#! ${pkgs.stdenv.shell} -e
|
||||||
|
${def.postStop}
|
||||||
|
''}
|
||||||
|
''}
|
||||||
|
|
||||||
${attrsToSection def.serviceConfig}
|
${attrsToSection def.serviceConfig}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user