Code review comment for lp:~s-matyukevich/charms/trusty/logstash-agent/logstash-agent-1.4.2

Revision history for this message
Sergey Matyukevich (s-matyukevich) wrote :

Reviewers: mp+241382_code.launchpad.net,

Message:
Please take a look.

Description:
Logstash version updated to 1.4.2

https://code.launchpad.net/~s-matyukevich/charms/trusty/logstash-agent/logstash-agent-1.4.2/+merge/241382

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/172270043/

Affected files (+18, -14 lines):
   A [revision details]
   M files/charm/logstash-agent.conf
   M hooks/common.sh
   M hooks/install

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: hooks/common.sh
=== modified file 'hooks/common.sh'
--- hooks/common.sh 2012-11-18 22:33:19 +0000
+++ hooks/common.sh 2014-11-10 09:51:05 +0000
@@ -3,9 +3,9 @@
  #set -eux # -x for verbose logging to juju debug-log

  # Set CONFIG constants
-VERSION="1.1.4"
-BASEURL="https://logstash.objects.dreamhost.com/release"
-CHECKSUM="68ac6c953aad026752f69ae7c15b13f4"
+VERSION="1.4.2"
+BASEURL="https://download.elasticsearch.org/logstash/logstash"
+CHECKSUM="6e6be734392e8c7d6d55e23d0bd8d2b3"
  BASEPATH="/opt/logstash-agent"
  USER="logstash"
  HOST=`unit-get private-address`
@@ -15,4 +15,4 @@
  # USER=$(config-get user)
  # juju-log "Logstash User: ${USER}"

-juju-log "Finished loading config variables"
\ No newline at end of file
+juju-log "Finished loading config variables"

Index: hooks/install
=== modified file 'hooks/install'
--- hooks/install 2012-12-02 23:34:57 +0000
+++ hooks/install 2014-11-10 09:51:05 +0000
@@ -11,7 +11,7 @@
  # set redis listener
  juju-log "Install upstart init script"
  install -o root -g root -m 0644 ${HOME}/files/charm/logstash-agent.conf
/etc/init/logstash-agent.conf
-sed -i "s|BASEPATH|${BASEPATH}|g" /etc/init/logstash-agent.conf
+sed -i "s|BASEPATH|${BASEPATH}|g;s|VERSION|${VERSION}|g"
/etc/init/logstash-agent.conf
  juju-log "create logstash user"
  [ -z "$(id ${USER})"] && useradd ${USER}
  juju-log "create skeleton dir"
@@ -21,18 +21,21 @@
  mkdir -p ${BASEPATH}/logs
  juju-log "install logstash and create config files"
  # Check if a local copy of the jar exists
-if [ -f ${HOME}/files/charm/logstash-${VERSION}-monolithic.jar ]
+if [ -f ${HOME}/files/charm/logstash-${VERSION}.tar.gz ]
  then
- install -o root -g root -m 0644
${HOME}/files/charm/logstash-${VERSION}-monolithic.jar
${BASEPATH}/bin/logstash-monolithic.jar
+ install -o root -g root -m 0644
${HOME}/files/charm/logstash-${VERSION}.tar.gz
${BASEPATH}/bin/logstash.tar.gz
  else
    # Download logstash monolithic jar and checksum
- wget -q -O ${BASEPATH}/bin/logstash-monolithic.jar
${BASEURL}/logstash-${VERSION}-monolithic.jar
- if [[ $(md5sum "${BASEPATH}/bin/logstash-monolithic.jar" | cut -d " " -f
1) != ${CHECKSUM} ]]; then
- juju-log --log-level CRITICAL "Checksum of
${BASEPATH}/bin/logstash-monolithic.jar failed"
+ wget -q -O ${BASEPATH}/bin/logstash.tar.gz
${BASEURL}/logstash-${VERSION}.tar.gz
+ if [[ $(md5sum "${BASEPATH}/bin/logstash.tar.gz" | cut -d " " -f 1) !=
${CHECKSUM} ]]; then
+ juju-log --log-level CRITICAL "Checksum of
${BASEPATH}/bin/logstash.tar.gz failed"
      exit 1
    fi
  fi

+juju-log "unpacking logstash"
+tar zxf ${BASEPATH}/bin/logstash.tar.gz -C ${BASEPATH}/bin/
+
  juju-log "install syslog input config"
  install -o root -g root -m 0644 ${HOME}/files/charm/input_file_syslog.conf
${BASEPATH}/conf.d/input_file_syslog.conf
  sed -i "s|BASEPATH|${BASEPATH}|g" ${BASEPATH}/conf.d/input_file_syslog.conf
@@ -41,4 +44,4 @@
  echo "output { file { path => \"${BASEPATH}/logs/logstash-output.log\" }
} " > ${BASEPATH}/conf.d/output_file.conf

  juju-log "Make sure ${USER} user owns the whole kit and kaboodle"
-chown -R ${USER}. ${BASEPATH}
\ No newline at end of file
+chown -R ${USER}. ${BASEPATH}

Index: files/charm/logstash-agent.conf
=== modified file 'files/charm/logstash-agent.conf'
--- files/charm/logstash-agent.conf 2012-11-18 22:33:19 +0000
+++ files/charm/logstash-agent.conf 2014-11-10 09:51:05 +0000
@@ -11,12 +11,11 @@
  respawn
  respawn limit 5 30
  env HOME=BASEPATH
-env JAVA_OPTS='-Xms512m -Xmx512m'
  chdir BASEPATH
  setuid logstash
  setgid adm
  console log

  script
- java -jar BASEPATH/bin/logstash-monolithic.jar agent -f BASEPATH/conf.d/
--log BASEPATH/logs/logstash-agent.log -v
-end script
\ No newline at end of file
+ bash BASEPATH/bin/logstash-VERSION/bin/logstash agent -f BASEPATH/conf.d/
--log BASEPATH/logs/logstash-agent.log -v
+end script

« Back to merge proposal