Implementing missing cygrunsrv properties
This commit is contained in:
parent
5384e7bb51
commit
dea82c9680
|
@ -26,12 +26,6 @@
|
||||||
, postInstall
|
, postInstall
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO: credentials
|
|
||||||
# TODO: directory unused
|
|
||||||
# TODO: umask unused
|
|
||||||
# TODO: nice unused
|
|
||||||
# TODO: user unused
|
|
||||||
|
|
||||||
let
|
let
|
||||||
generateForegroundProxy = import ../util/generate-foreground-proxy.nix {
|
generateForegroundProxy = import ../util/generate-foreground-proxy.nix {
|
||||||
inherit stdenv lib writeTextFile;
|
inherit stdenv lib writeTextFile;
|
||||||
|
@ -43,16 +37,16 @@ let
|
||||||
environmentPath = path;
|
environmentPath = path;
|
||||||
|
|
||||||
path = if foregroundProcess != null then
|
path = if foregroundProcess != null then
|
||||||
if initialize == "" then foregroundProcess
|
if initialize == "" && nice == null && directory == null && umask == null then foregroundProcess
|
||||||
else generateForegroundProxy {
|
else generateForegroundProxy {
|
||||||
wrapDaemon = false;
|
wrapDaemon = false;
|
||||||
executable = foregroundProcess;
|
executable = foregroundProcess;
|
||||||
inherit name initialize runtimeDir pidFile stdenv;
|
inherit name initialize runtimeDir pidFile nice directory umask stdenv;
|
||||||
}
|
}
|
||||||
else generateForegroundProxy {
|
else generateForegroundProxy {
|
||||||
wrapDaemon = true;
|
wrapDaemon = true;
|
||||||
executable = daemon;
|
executable = daemon;
|
||||||
inherit name initialize runtimeDir pidFile stdenv;
|
inherit name initialize runtimeDir pidFile nice stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
args = if foregroundProcess != null then foregroundProcessArgs else daemonArgs;
|
args = if foregroundProcess != null then foregroundProcessArgs else daemonArgs;
|
||||||
|
@ -61,5 +55,8 @@ let
|
||||||
targetSpecificArgs =
|
targetSpecificArgs =
|
||||||
if builtins.isFunction overrides then overrides generatedTargetSpecificArgs
|
if builtins.isFunction overrides then overrides generatedTargetSpecificArgs
|
||||||
else lib.recursiveUpdate generatedTargetSpecificArgs overrides;
|
else lib.recursiveUpdate generatedTargetSpecificArgs overrides;
|
||||||
|
|
||||||
|
cygrunSrvConfig = createCygrunsrvParams targetSpecificArgs;
|
||||||
in
|
in
|
||||||
createCygrunsrvParams targetSpecificArgs
|
if credentials == {} && user == null then cygrunSrvConfig else
|
||||||
|
builtins.trace "It is not possible to create any users for cygrunsrv services. Cygwin automatically converts Windows users to UNIX users" cygrunSrvConfig
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
, pidFile ? (if instanceName == null then null else "${runtimeDir}/${instanceName}.pid")
|
, pidFile ? (if instanceName == null then null else "${runtimeDir}/${instanceName}.pid")
|
||||||
, user ? null
|
, user ? null
|
||||||
, nice ? null
|
, nice ? null
|
||||||
|
, directory ? null
|
||||||
|
, umask ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -43,6 +45,13 @@ writeTextFile {
|
||||||
trap _term SIGTERM
|
trap _term SIGTERM
|
||||||
trap _interrupt SIGINT
|
trap _interrupt SIGINT
|
||||||
|
|
||||||
|
${lib.optionalString (directory != null) ''
|
||||||
|
cd ${directory}
|
||||||
|
''}
|
||||||
|
${lib.optionalString (umask != null) ''
|
||||||
|
umask ${umask}
|
||||||
|
''}
|
||||||
|
|
||||||
# Start process in the background as a daemon
|
# Start process in the background as a daemon
|
||||||
${lib.optionalString (user != null) "${chainload-user}/bin/nixproc-chainload-user ${user} "}${lib.optionalString (nice != null) "nice -n ${nice} "}${executable} "$@"
|
${lib.optionalString (user != null) "${chainload-user}/bin/nixproc-chainload-user ${user} "}${lib.optionalString (nice != null) "nice -n ${nice} "}${executable} "$@"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue