systemd: Support reload scripts
This commit is contained in:
parent
c27594d8b4
commit
4d193b7262
@ -230,6 +230,15 @@ in rec {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
reload = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Shell commands executed when the service's main process
|
||||||
|
is reloaded.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
preStop = mkOption {
|
preStop = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -245,6 +245,12 @@ let
|
|||||||
${config.postStart}
|
${config.postStart}
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
(mkIf (config.reload != "")
|
||||||
|
{ serviceConfig.ExecReload = makeJobScript "${name}-reload" ''
|
||||||
|
#! ${pkgs.stdenv.shell} -e
|
||||||
|
${config.reload}
|
||||||
|
'';
|
||||||
|
})
|
||||||
(mkIf (config.preStop != "")
|
(mkIf (config.preStop != "")
|
||||||
{ serviceConfig.ExecStop = makeJobScript "${name}-pre-stop" ''
|
{ serviceConfig.ExecStop = makeJobScript "${name}-pre-stop" ''
|
||||||
#! ${pkgs.stdenv.shell} -e
|
#! ${pkgs.stdenv.shell} -e
|
||||||
|
Loading…
Reference in New Issue
Block a user