Skip to content

Commit

Permalink
Tarball packages. Homogenized init. Common defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
fayep authored and Faye Salwin committed Feb 24, 2014
1 parent d62bffe commit 3537c6b
Show file tree
Hide file tree
Showing 44 changed files with 382 additions and 1,358 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,10 @@ releaseNote:
$(QUIET)curl -si "https://logstash.jira.com/secure/ReleaseNote.jspa?version=$(JIRA_VERSION_ID)&projectId=10020" | sed -n '/<textarea.*>/,/<\/textarea>/p' | grep textarea -v >> releaseNote.html
$(QUIET)ruby pull_release_note.rb

package:
[ ! -f build/logstash-$(VERSION)-flatjar.jar ] \
&& make build/logstash-$(VERSION)-flatjar.jar ; \
package: build/logstash-$(VERSION).tar.gz
(cd pkg; \
./build.sh ubuntu 12.10; \
./build.sh centos 6; \
./build.sh debian 6; \
./build.sh ubuntu 12.04; \
./build.sh centos 6 \
)

vendor/kibana: | vendor
Expand Down
3 changes: 3 additions & 0 deletions bin/logstash
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ basedir=$(cd `dirname $0`/..; pwd)

setup

# Export these so that they can be picked up by file input (and others?).
export HOME SINCEDB_DIR

case $1 in
deps) install_deps ;;
-*)
Expand Down
50 changes: 20 additions & 30 deletions pkg/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

# We only need to build two packages now, rpm and deb. Leaving the os/version stuff in case things change.

[ ! -f ../.VERSION.mk ] && make -C .. .VERSION.mk

Expand All @@ -12,7 +12,6 @@ if ! git show-ref --tags | grep -q "$(git rev-parse HEAD)"; then
RPM_REVISION=".${BUILD_TIME}.${REVISION}"
fi


URL="http://logstash.net"
DESCRIPTION="An extensible logging pipeline"

Expand All @@ -37,18 +36,17 @@ fi

mkdir -p $destdir/$prefix


# install logstash.jar
jar="$(dirname $0)/../build/logstash-$VERSION-flatjar.jar"
if [ ! -f "$jar" ] ; then
echo "Unable to find $jar"
exit 1
# Deploy the tarball to /opt/logstash
tar="$(dirname $0)/../build/logstash-$VERSION.tar.gz"
if [ ! -f "$tar" ] ; then
echo "Unable to find $tar"
exit 1
fi

cp $jar $destdir/$prefix/logstash.jar
tar -C $destdir/$prefix --strip-components 1 -zxf $tar

case $os@$release in
centos@*)
centos@*|fedora@*|el6@*|sl6@*)
mkdir -p $destdir/etc/logrotate.d
mkdir -p $destdir/etc/sysconfig
mkdir -p $destdir/etc/init.d
Expand All @@ -57,36 +55,28 @@ case $os@$release in
mkdir -p $destdir/var/lib/logstash
mkdir -p $destdir/var/run/logstash
mkdir -p $destdir/var/log/logstash
cp $os/sysconfig $destdir/etc/sysconfig/logstash
chmod 0755 $destdir/opt/logstash/bin/logstash
install -m644 logrotate.conf $destdir/etc/logrotate.d/logstash
install -m644 logstash.default $destdir/etc/sysconfig/logstash
install -m755 logstash.sysv.redhat $destdir/etc/init.d/logstash
install -m644 logstash-web.default $destdir/etc/sysconfig/logstash
install -m755 logstash-web.sysv.redhat $destdir/etc/init.d/logstash-web
;;
ubuntu@*)
ubuntu@*|debian@*)
mkdir -p $destdir/etc/logstash/conf.d
mkdir -p $destdir/etc/logrotate.d
mkdir -p $destdir/etc/init
mkdir -p $destdir/var/lib/logstash
mkdir -p $destdir/var/log/logstash
mkdir -p $destdir/etc/default
touch $destdir/etc/default/logstash
install -m644 logrotate.conf $destdir/etc/logrotate.d/logstash
install -m644 logstash.default $destdir/etc/default/logstash
install -m644 logstash-web.default $destdir/etc/default/logstash-web
install -m755 logstash.upstart.ubuntu $destdir/etc/init/logstash.conf
install -m755 logstash-web.upstart.ubuntu $destdir/etc/init/logstash-web.conf
;;
debian@*)
mkdir -p $destdir/etc/logstash/conf.d
mkdir -p $destdir/etc/logrotate.d
mkdir -p $destdir/etc/init.d
mkdir -p $destdir/var/lib/logstash
mkdir -p $destdir/var/log/logstash
mkdir -p $destdir/etc/default
touch $destdir/etc/default/logstash
install -m644 logrotate.conf $destdir/etc/logrotate.d/logstash
install -m644 logstash.default $destdir/etc/default/logstash
install -m644 logstash-web.default $destdir/etc/default/logstash-web
install -m755 logstash.upstart.ubuntu $destdir/etc/init/logstash.conf
install -m755 logstash.sysv.debian $destdir/etc/init.d/logstash
install -m644 logstash-web.default $destdir/etc/default/logstash-web
install -m755 logstash-web.upstart.ubuntu $destdir/etc/init/logstash-web.conf
install -m755 logstash-web.sysv.debian $destdir/etc/init.d/logstash-web
;;
*)
Expand All @@ -97,9 +87,9 @@ esac

description="logstash is a system for managing and processing events and logs"
case $os in
centos|fedora|redhat)
centos|fedora|redhat|sl)
fpm -s dir -t rpm -n logstash -v "$RELEASE" \
-a noarch --iteration "1_${os}${RPM_REVISION}" \
-a noarch --iteration "1_${RPM_REVISION}" \
--url "$URL" \
--description "$DESCRIPTION" \
-d "jre >= 1.6.0" \
Expand All @@ -121,12 +111,12 @@ case $os in
fi

fpm -s dir -t deb -n logstash -v "$RELEASE" \
-a all --iteration "1-${os}${DEB_REVISION}" \
-a all --iteration "1-${DEB_REVISION}" \
--url "$URL" \
--description "$DESCRIPTION" \
--vendor "Elasticsearch" \
--license "Apache 2.0" \
-d "java7-runtime-headless | java6-runtime-headless" \
-d "java7-runtime-headless | java6-runtime-headless | j2re1.7" \
--deb-user root --deb-group root \
--before-install $os/before-install.sh \
--before-remove $os/before-remove.sh \
Expand Down
6 changes: 6 additions & 0 deletions pkg/centos/after-install.sh
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/sbin/chkconfig --add logstash

chown -R logstash:logstash /opt/logstash
chown logstash /var/log/logstash
chown logstash:logstash /var/lib/logstash
chmod +x /etc/rc.d/init.d/logstash
chmod +x /opt/logstash/bin/logstash
15 changes: 0 additions & 15 deletions pkg/centos/sysconfig

This file was deleted.

1 change: 0 additions & 1 deletion pkg/debian/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ if ! getent passwd logstash >/dev/null; then
useradd -M -r -g logstash -d /var/lib/logstash \
-s /sbin/nologin -c "LogStash Service User" logstash
fi

2 changes: 1 addition & 1 deletion pkg/debian/before-remove.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

if [ $1 = "remove" ]; then
/etc/init.d/logstash stop >/dev/null 2>&1 || true
service logstash stop >/dev/null 2>&1 || true

if getent passwd logstash >/dev/null ; then
userdel logstash
Expand Down
34 changes: 0 additions & 34 deletions pkg/debian/build.sh

This file was deleted.

6 changes: 0 additions & 6 deletions pkg/debian/debian/README

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/debian/debian/changelog

This file was deleted.

1 change: 0 additions & 1 deletion pkg/debian/debian/compat

This file was deleted.

16 changes: 0 additions & 16 deletions pkg/debian/debian/control

This file was deleted.

27 changes: 0 additions & 27 deletions pkg/debian/debian/copyright

This file was deleted.

19 changes: 0 additions & 19 deletions pkg/debian/debian/dirs

This file was deleted.

Empty file removed pkg/debian/debian/docs
Empty file.
39 changes: 0 additions & 39 deletions pkg/debian/debian/logstash.default

This file was deleted.

Loading

0 comments on commit 3537c6b

Please sign in to comment.