mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
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 {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -250,6 +250,13 @@ let
|
||||
''}
|
||||
''}
|
||||
|
||||
${optionalString (def.postStop != "") ''
|
||||
ExecStopPost=${makeJobScript "${name}-poststop.sh" ''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${def.postStop}
|
||||
''}
|
||||
''}
|
||||
|
||||
${attrsToSection def.serviceConfig}
|
||||
'';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user