Skip to content

Commit

Permalink
Updated debian packaging to use the new layout
Browse files Browse the repository at this point in the history
* Follows the layout as defined in elastic#1371, setting path.home, path.config
  and path.data
* This removes the need to adjust the configuration file
  • Loading branch information
Tudor Golubenco committed Apr 13, 2016
1 parent 2023850 commit a3878b2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 39 deletions.
2 changes: 1 addition & 1 deletion dev-tools/packer/docker/fpm-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ MAINTAINER Tudor Golubenco <[email protected]>
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential ruby-dev rpm zip dos2unix && \
build-essential ruby-dev rpm zip dos2unix libgmp3-dev && \
gem install fpm
24 changes: 0 additions & 24 deletions dev-tools/packer/platforms/debian/fpm-run.sh.j2

This file was deleted.

6 changes: 3 additions & 3 deletions dev-tools/packer/platforms/debian/init.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="{{.beat_description}}"
NAME="{{.beat_name}}"
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="-c /etc/{{.beat_name}}/{{.beat_name}}.yml"
DAEMON=/usr/share/{{.beat_name}}/bin/$NAME
DAEMON_ARGS="-c /etc/{{.beat_name}}/{{.beat_name}}.yml -path.home /usr/sahre/{{.beat_name}} -path.config /etc/{{.beat_name}} -path.data /var/lib/{{.beat_name}}"
TEST_ARGS="-e -configtest"
PIDFILE=/var/run/{{.beat_name}}.pid
WRAPPER="/usr/bin/{{.beat_name}}-god"
WRAPPER="/usr/share/{{.beat_name}}/bin/{{.beat_name}}-god"
WRAPPER_ARGS="-r / -n -p $PIDFILE"
SCRIPTNAME=/etc/init.d/$NAME

Expand Down
4 changes: 2 additions & 2 deletions dev-tools/packer/platforms/debian/run.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ fpm --force -s dir -t deb \
--deb-init /tmp/{{.beat_name}}.init \
--after-install /tmp/systemd-daemon-reload.sh \
--config-files /etc/{{.beat_name}}/{{.beat_name}}.yml \
{{.beat_name}}-linux-{{.arch}}=/usr/bin/{{.beat_name}} \
{{.beat_name}}-linux-{{.arch}}=/usr/share/{{.beat_name}}/bin/{{.beat_name}} \
{{.beat_name}}-linux.yml=/etc/{{.beat_name}}/{{.beat_name}}.yml \
{{.beat_name}}.template.json=/etc/{{.beat_name}}/{{.beat_name}}.template.json \
${RUNID}.service=/lib/systemd/system/{{.beat_name}}.service \
god-linux-{{.arch}}=/usr/bin/{{.beat_name}}-god
god-linux-{{.arch}}=/usr/share/{{.beat_name}}/bin/{{.beat_name}}-god

# move and rename so that the filename respects semver rules
mkdir -p upload/{{.beat_name}}
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/packer/platforms/debian/systemd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/{{.beat_name}} -c /etc/{{.beat_name}}/{{.beat_name}}.yml
ExecStart=/usr/share/{{.beat_name}}/bin/{{.beat_name}} -c /etc/{{.beat_name}}/{{.beat_name}}.yml -path.home /usr/sahre/{{.beat_name}} -path.config /etc/{{.beat_name}} -path.data /var/lib/{{.beat_name}}
Restart=always

[Install]
Expand Down
4 changes: 0 additions & 4 deletions dev-tools/packer/xgo-scripts/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ PREFIX=/build

echo $PREFIX


# Copy template
cp $BEATNAME.template.json $PREFIX/$BEATNAME.template.json

# linux
cp $BEATNAME.yml $PREFIX/$BEATNAME-linux.yml

# Updates template path for linux distros
sed -i "s@path: \"$BEATNAME.template.json\"@path: \"/etc/$BEATNAME/$BEATNAME.template.json\"@" $PREFIX/$BEATNAME-linux.yml

# binary
cp $BEATNAME.yml $PREFIX/$BEATNAME-binary.yml

Expand Down
4 changes: 0 additions & 4 deletions filebeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ include ../libbeat/scripts/Makefile
# This is called by the beats packer before building starts
.PHONY: before-build
before-build:
# linux
sed -i 's@#registry_file: .filebeat@registry_file: /var/lib/filebeat/registry@' $(PREFIX)/filebeat-linux.yml
# win
sed -i 's@#registry_file: .filebeat@registry_file: "C:/ProgramData/filebeat/registry"@' $(PREFIX)/filebeat-win.yml

0 comments on commit a3878b2

Please sign in to comment.