summaryrefslogtreecommitdiff
path: root/src/deb/control
diff options
context:
space:
mode:
authorHilko Bengen <bengen@debian.org>2014-06-07 12:02:12 +0200
committerHilko Bengen <bengen@debian.org>2014-06-07 12:02:12 +0200
commitd5ed89b946297270ec28abf44bef2371a06f1f4f (patch)
treece2d945e4dde69af90bd9905a70d8d27f4936776 /src/deb/control
downloadelasticsearch-d5ed89b946297270ec28abf44bef2371a06f1f4f.tar.gz
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'src/deb/control')
-rw-r--r--src/deb/control/conffiles4
-rw-r--r--src/deb/control/control38
-rwxr-xr-xsrc/deb/control/postinst52
-rwxr-xr-xsrc/deb/control/postrm33
-rwxr-xr-xsrc/deb/control/prerm26
5 files changed, 153 insertions, 0 deletions
diff --git a/src/deb/control/conffiles b/src/deb/control/conffiles
new file mode 100644
index 0000000..98e0f5a
--- /dev/null
+++ b/src/deb/control/conffiles
@@ -0,0 +1,4 @@
+/etc/init.d/elasticsearch
+/etc/default/elasticsearch
+/etc/elasticsearch/logging.yml
+/etc/elasticsearch/elasticsearch.yml
diff --git a/src/deb/control/control b/src/deb/control/control
new file mode 100644
index 0000000..b6207b2
--- /dev/null
+++ b/src/deb/control/control
@@ -0,0 +1,38 @@
+Package: elasticsearch
+Version: [[version]]
+Architecture: all
+Maintainer: Elasticsearch Team <info@elasticsearch.com>
+Depends: libc6, adduser
+Section: web
+Priority: optional
+Homepage: http://www.elasticsearch.org/
+Description: Open Source, Distributed, RESTful Search Engine
+ Elasticsearch is a distributed RESTful search engine built for the cloud.
+ .
+ Features include:
+ .
+ + Distributed and Highly Available Search Engine.
+ - Each index is fully sharded with a configurable number of shards.
+ - Each shard can have one or more replicas.
+ - Read / Search operations performed on either one of the replica shard.
+ + Multi Tenant with Multi Types.
+ - Support for more than one index.
+ - Support for more than one type per index.
+ - Index level configuration (number of shards, index storage, ...).
+ + Various set of APIs
+ - HTTP RESTful API
+ - Native Java API.
+ - All APIs perform automatic node operation rerouting.
+ + Document oriented
+ - No need for upfront schema definition.
+ - Schema can be defined per type for customization of the indexing process.
+ + Reliable, Asynchronous Write Behind for long term persistency.
+ + (Near) Real Time Search.
+ + Built on top of Lucene
+ - Each shard is a fully functional Lucene index
+ - All the power of Lucene easily exposed through simple
+ configuration/plugins.
+ + Per operation consistency
+ - Single document level operations are atomic, consistent, isolated and
+ durable.
+ + Open Source under Apache 2 License.
diff --git a/src/deb/control/postinst b/src/deb/control/postinst
new file mode 100755
index 0000000..166db9c
--- /dev/null
+++ b/src/deb/control/postinst
@@ -0,0 +1,52 @@
+#!/bin/sh
+set -e
+
+[ -f /etc/default/elasticsearch ] && . /etc/default/elasticsearch
+
+startElasticsearch() {
+ if [ -x "/etc/init.d/elasticsearch" ]; then
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d elasticsearch start || true
+ else
+ /etc/init.d/elasticsearch start || true
+ fi
+ fi
+}
+
+case "$1" in
+ configure)
+ [ -z "$ES_USER" ] && ES_USER="elasticsearch"
+ [ -z "$ES_GROUP" ] && ES_GROUP="elasticsearch"
+ if ! getent group "$ES_GROUP" > /dev/null 2>&1 ; then
+ addgroup --system "$ES_GROUP" --quiet
+ fi
+ if ! id $ES_USER > /dev/null 2>&1 ; then
+ adduser --system --home /usr/share/elasticsearch --no-create-home \
+ --ingroup "$ES_GROUP" --disabled-password --shell /bin/false \
+ "$ES_USER"
+ fi
+
+ # Set user permissions on /var/log/elasticsearch and /var/lib/elasticsearch
+ mkdir -p /var/log/elasticsearch /var/lib/elasticsearch
+ chown -R $ES_USER:$ES_GROUP /var/log/elasticsearch /var/lib/elasticsearch
+ chmod 755 /var/log/elasticsearch /var/lib/elasticsearch
+
+ # configuration files should not be modifiable by elasticsearch user, as this can be a security issue
+ chown -Rh root:root /etc/elasticsearch/*
+ chmod 755 /etc/elasticsearch
+ find /etc/elasticsearch -type f -exec chmod 644 {} ';'
+ find /etc/elasticsearch -type d -exec chmod 755 {} ';'
+
+ # if $2 is set, this is an upgrade
+ if ( [ -n $2 ] && [ "$RESTART_ON_UPGRADE" = "true" ] ) ; then
+ startElasticsearch
+ # this is a fresh installation
+ elif [ -z $2 ] ; then
+ echo "### NOT starting elasticsearch by default on bootup, please execute"
+ echo " sudo update-rc.d elasticsearch defaults 95 10"
+ echo "### In order to start elasticsearch, execute"
+ echo " sudo /etc/init.d/elasticsearch start"
+ fi
+ ;;
+esac
+
diff --git a/src/deb/control/postrm b/src/deb/control/postrm
new file mode 100755
index 0000000..59b6048
--- /dev/null
+++ b/src/deb/control/postrm
@@ -0,0 +1,33 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ remove)
+ # Remove logs
+ rm -rf /var/log/elasticsearch
+
+ # remove **only** empty data dir
+ rmdir -p --ignore-fail-on-non-empty /var/lib/elasticsearch
+ ;;
+
+ purge)
+ # Remove service
+ update-rc.d elasticsearch remove >/dev/null || true
+
+ # Remove logs and data
+ rm -rf /var/log/elasticsearch /var/lib/elasticsearch
+
+ # Remove user/group
+ deluser elasticsearch || true
+ delgroup elasticsearch || true
+ ;;
+
+ upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ # Nothing to do here
+ ;;
+
+ *)
+ echo "$0 called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
diff --git a/src/deb/control/prerm b/src/deb/control/prerm
new file mode 100755
index 0000000..fb3c9eb
--- /dev/null
+++ b/src/deb/control/prerm
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+
+[ -f /etc/default/elasticsearch ] && . /etc/default/elasticsearch
+
+stopElasticsearch() {
+ if [ -x "/etc/init.d/elasticsearch" ]; then
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d elasticsearch stop || true
+ else
+ /etc/init.d/elasticsearch stop || true
+ fi
+ fi
+}
+
+case "$1" in
+ upgrade)
+ if [ "$RESTART_ON_UPGRADE" = "true" ] ; then
+ stopElasticsearch
+ fi
+ ;;
+ remove)
+ stopElasticsearch
+ ;;
+esac
+