diff options
author | Dan Peebles <pumpkin@me.com> | 2017-02-27 18:32:09 +0000 |
---|---|---|
committer | Dan Peebles <pumpkin@me.com> | 2017-02-27 18:32:12 +0000 |
commit | 8def08a56cf304fbc55090b280e35b798b72055a (patch) | |
tree | 09118cd6a18401f48d0b4d75f5ddcd312a38be68 /nixos/modules/services/misc/apache-kafka.nix | |
parent | 7ef26640f604f7745d07fde71aaa401a3c211149 (diff) | |
download | nixlib-8def08a56cf304fbc55090b280e35b798b72055a.tar nixlib-8def08a56cf304fbc55090b280e35b798b72055a.tar.gz nixlib-8def08a56cf304fbc55090b280e35b798b72055a.tar.bz2 nixlib-8def08a56cf304fbc55090b280e35b798b72055a.tar.lz nixlib-8def08a56cf304fbc55090b280e35b798b72055a.tar.xz nixlib-8def08a56cf304fbc55090b280e35b798b72055a.tar.zst nixlib-8def08a56cf304fbc55090b280e35b798b72055a.zip |
apache-kafka.service: pass in log4j config more explicitly
The implicit behavior of pulling it out of the classpath seemed not to work properly and could be thrown off by other things on the classpath also providing the properties file. This guarantees that our settings stick.
Diffstat (limited to 'nixos/modules/services/misc/apache-kafka.nix')
-rw-r--r-- | nixos/modules/services/misc/apache-kafka.nix | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/nixos/modules/services/misc/apache-kafka.nix b/nixos/modules/services/misc/apache-kafka.nix index cff053396885..82fa1cc2e7e5 100644 --- a/nixos/modules/services/misc/apache-kafka.nix +++ b/nixos/modules/services/misc/apache-kafka.nix @@ -19,13 +19,8 @@ let ${toString cfg.extraProperties} ''; - configDir = pkgs.buildEnv { - name = "apache-kafka-conf"; - paths = [ - (pkgs.writeTextDir "server.properties" serverProperties) - (pkgs.writeTextDir "log4j.properties" cfg.log4jProperties) - ]; - }; + serverConfig = pkgs.writeText "server.properties" serverProperties; + logConfig = pkgs.writeText "log4j.properties" cfg.log4jProperties; in { @@ -143,10 +138,11 @@ in { serviceConfig = { ExecStart = '' ${pkgs.jre}/bin/java \ - -cp "${cfg.package}/libs/*:${configDir}" \ + -cp "${cfg.package}/libs/*" \ + -Dlog4j.configuration=file:${logConfig} \ ${toString cfg.jvmOptions} \ kafka.Kafka \ - ${configDir}/server.properties + ${serverConfig} ''; User = "apache-kafka"; PermissionsStartOnly = true; |