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.
This commit is contained in:
Dan Peebles 2017-02-27 18:32:09 +00:00
parent 7ef26640f6
commit 8def08a56c

View File

@ -19,13 +19,8 @@ let
${toString cfg.extraProperties} ${toString cfg.extraProperties}
''; '';
configDir = pkgs.buildEnv { serverConfig = pkgs.writeText "server.properties" serverProperties;
name = "apache-kafka-conf"; logConfig = pkgs.writeText "log4j.properties" cfg.log4jProperties;
paths = [
(pkgs.writeTextDir "server.properties" serverProperties)
(pkgs.writeTextDir "log4j.properties" cfg.log4jProperties)
];
};
in { in {
@ -143,10 +138,11 @@ in {
serviceConfig = { serviceConfig = {
ExecStart = '' ExecStart = ''
${pkgs.jre}/bin/java \ ${pkgs.jre}/bin/java \
-cp "${cfg.package}/libs/*:${configDir}" \ -cp "${cfg.package}/libs/*" \
-Dlog4j.configuration=file:${logConfig} \
${toString cfg.jvmOptions} \ ${toString cfg.jvmOptions} \
kafka.Kafka \ kafka.Kafka \
${configDir}/server.properties ${serverConfig}
''; '';
User = "apache-kafka"; User = "apache-kafka";
PermissionsStartOnly = true; PermissionsStartOnly = true;