mirror of
https://github.com/kiberpipa/nix-rehash.git
synced 2024-09-11 11:55:33 +03:00
Add support for forking services
This commit is contained in:
parent
3b862ceec3
commit
aba8854afc
@ -27,6 +27,9 @@ let
|
||||
default = 1;
|
||||
example = 0;
|
||||
};
|
||||
pidfile = mkOption {
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
services = config.supervisord.services;
|
||||
@ -78,7 +81,7 @@ in {
|
||||
in
|
||||
''
|
||||
[program:${name}]
|
||||
command=${cfg.command}
|
||||
command=${if cfg.pidfile == null then cfg.command else "${pkgs.pythonPackages.supervisor}/bin/pidproxy ${cfg.pidfile} ${cfg.command}"}
|
||||
environment=${concatStrings
|
||||
(mapAttrsToList (name: value: "${name}=\"${value}\",") (
|
||||
cfg.environment // { PATH = concatStringsSep ":"
|
||||
|
@ -57,6 +57,7 @@ in {
|
||||
stopsignal = if hasAttr "KillSignal" cfg.serviceConfig then
|
||||
substring 3 (stringLength cfg.serviceConfig.KillSignal) cfg.serviceConfig.KillSignal
|
||||
else "TERM";
|
||||
pidfile = if hasAttr "PIDFile" cfg.serviceConfig then cfg.serviceConfig.PIDFile else null;
|
||||
};
|
||||
}
|
||||
) (attrNames (filterAttrs (n: v: v.enable) runServices)));
|
||||
|
Loading…
Reference in New Issue
Block a user