Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files being generated without newlines #189

Open
Josh5K opened this issue Oct 1, 2020 · 4 comments
Open

Files being generated without newlines #189

Josh5K opened this issue Oct 1, 2020 · 4 comments

Comments

@Josh5K
Copy link

Josh5K commented Oct 1, 2020

👻 Brief Description

After running kitchen converge we are seeing /etc/sysconfig/kafka and /usr/local/kafka/config/log4j.properties which are generated by this cookbook are missing linebreaks.

Examples

  • /etc/sysconfig/kafka
SCALA_VERSION="2.11"KAFKA_OPTS=""JMX_PORT="9999"KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseCompressedOops -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC -Djava.awt.headless=true"KAFKA_GC_LOG_OPTS="-Xloggc:/var/log/kafka/kafka-gc.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps"KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/usr/local/kafka/config/log4j.properties"KAFKA_HEAP_OPTS="-Xmx256M -Xms256M"KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"KAFKA_RUN="/usr/local/kafka/bin/kafka-run-class.sh"KAFKA_ARGS="kafka.Kafka"KAFKA_CONFIG="/usr/local/kafka/config/server.properties"
  • /usr/local/kafka/config/log4j.properties
# Generated by Chef.
# Local modifications will be overwritten.

log4j.rootLogger=INFO, kafkaAppender

log4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.controllerAppender.DatePattern=.yyyy-MM-ddlog4j.appender.controllerAppender.File=/var/log/kafka/kafka-controller.loglog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayoutlog4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.kafkaAppender.DatePattern=.yyyy-MM-ddlog4j.appender.kafkaAppender.File=/var/log/kafka/kafka.loglog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayoutlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.requestAppender.DatePattern=.yyyy-MM-ddlog4j.appender.requestAppender.File=/var/log/kafka/kafka-request.loglog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayoutlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.stateChangeAppender.DatePattern=.yyyy-MM-ddlog4j.appender.stateChangeAppender.File=/var/log/kafka/kafka-state-change.loglog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayoutlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n

log4j.logger.kafka.controller=INFO, controllerAppenderlog4j.additivity.kafka.controller=false

log4j.logger.kafka.network.RequestChannel$=WARN, requestAppenderlog4j.additivity.kafka.network.RequestChannel$=false

log4j.logger.kafka.request.logger=WARN, requestAppenderlog4j.additivity.kafka.request.logger=false

log4j.logger.org.IOItec.zkclient.ZkClient=INFO

log4j.logger.state.change.logger=INFO, stateChangeAppenderlog4j.additivity.state.change.logger=false

🥞 Cookbook version

3.1.0

👩‍🍳 Chef-Infra Version

Chef Client, version 14.15.6

🎩 Platform details

Centos 7 dokken

Steps To Reproduce

Steps to reproduce the behavior:

  1. Converge Kafka cookbook.
  2. Check contents of /etc/sysconfig/kafka
  3. Check contents of /usr/local/kafka/config/log4j.properties

🚓 Expected behavior

Files are generated with their expected line breaks.

@ramereth
Copy link
Contributor

ramereth commented Oct 1, 2020

@Josh5K please feel free to create a PR which fixes this!

@Josh5K
Copy link
Author

Josh5K commented Oct 2, 2020

I can put together a PR. I just have a quick question.

Where does the method render_variable get defined? The only reference I can find is where it is called in the env.erb templet file.

@ramereth
Copy link
Contributor

ramereth commented Oct 2, 2020

@Josh5K Looks like that was a part of a library file that was removed in #135.

@hrak
Copy link

hrak commented Apr 30, 2021

This issue is causing Kafka to fail to start up on Ubuntu due to lack of newlines in /etc/default/kafka. When i alter this file to have newlines the service starts up fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants