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

Update packaging #1385

Merged
merged 3 commits into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ https://github.com/elastic/beats/compare/v5.0.0-alpha1...master[Check the HEAD d
==== Breaking changes

*Affecting all Beats*

- Add scripts for managing the dashboards of a single Beat {pull}1359[1359]
- On DEB/RPM installations, the binary files are now found under `/usr/share/{{beat_name}}/bin`, not in `/usr/bin`. {pull}1385[1385]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we symlink the binary? Will that cause problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Symlinking might be confusing because without the correct -path.* parameters the Beats might behave quite different. An alternative idea is to have, say, a filebeat.sh that runs filebeat with the right parameters in foreground. Not sure how helpful that would be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that as a TODO in #1371, I'd prefer getting this one in quicker so we can test it with the nightlies.


*Packetbeat*

- Configuration of redis topology support changed. {pull}1353[1353]

*Topbeat*
Expand Down
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 <tudor@elastic.co>
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
6 changes: 3 additions & 3 deletions dev-tools/packer/platforms/centos/init.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export PATH

[ -f /etc/sysconfig/{{.beat_name}} ] && . /etc/sysconfig/{{.beat_name}}
pidfile=${PIDFILE-/var/run/{{.beat_name}}.pid}
agent=${PB_AGENT-/usr/bin/{{.beat_name}}}
args="-c /etc/{{.beat_name}}/{{.beat_name}}.yml"
agent=${BEATS_AGENT-/usr/share/{{.beat_name}}/bin/{{.beat_name}}}
args="-c /etc/{{.beat_name}}/{{.beat_name}}.yml -path.home /usr/share/{{.beat_name}} -path.config /etc/{{.beat_name}} -path.data /var/lib/{{.beat_name}}"
test_args="-e -configtest"
wrapper="{{.beat_name}}-god"
wrapper="/usr/share/{{.beat_name}}/bin/{{.beat_name}}-god"
wrapperopts="-r / -n -p $pidfile"
RETVAL=0

Expand Down
4 changes: 2 additions & 2 deletions dev-tools/packer/platforms/centos/run.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ fpm --force -s dir -t rpm \
--rpm-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


# rename so that the filename respects semver rules
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/packer/platforms/centos/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/share/{{.beat_name}} -path.config /etc/{{.beat_name}} -path.data /var/lib/{{.beat_name}}
Restart=always

[Install]
Expand Down
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/share/{{.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/share/{{.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