[ https://issues.apache.org/jira/browse/KAFKA-1234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16888782#comment-16888782 ]
Sönke Liebau commented on KAFKA-1234: ------------------------------------- I'm unsure what the "gospel" way of doing this is, but my personal belief is that tools that run Kafka as a service should allow for management of environment variables. Most prevalent these days is probably systemd, which makes this very easy. I have limited experience with Upstart but do believe this is possible, if somewhat awkward. For init.d scripts I have not really found an acceptable solution apart from sourcing an env file from the init.d script, but as Kafka does not include these you would have to create them yourself anyway, so sourcing something should not create any conflicts with updates etc. Relying on a file in the Kafka base dir bears the risk of losing this file during an update, depending on how that update is performed, so I'd prefer relying on external methods. > All kafka-run-class.sh to source in user config file (to set env vars like > KAFKA_OPTS) > -------------------------------------------------------------------------------------- > > Key: KAFKA-1234 > URL: https://issues.apache.org/jira/browse/KAFKA-1234 > Project: Kafka > Issue Type: Improvement > Components: config > Affects Versions: 0.8.0 > Reporter: Alex Gray > Priority: Trivial > Attachments: patch.txt > > > We are using the distributed version of kafka: > http://apache.mirrors.lucidnetworks.net/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz > And we would like to set some environment variables, particularly KAFKA_OPTS > when the kafka service starts. > In other words, when someone does a "sudo service kafka start" we would like > to set some environment variables. > We cannot do this *without* modifying either /etc/init.d/kafka or > bin/kafka-run-class.sh, and we don't want to modify files that we don't own. > The solution is to have kafka source in a user specific file that may have > these environment variables set. > I'm attaching the patch file to show you what I mean. -- This message was sent by Atlassian JIRA (v7.6.14#76016)