Starting up elasticsearch with /etc/init.d/elasticsearch start gives: * Caching service dependencies ... [ ok ] * Starting elasticsearch ... * start-stop-daemon: did not create a valid pid in `/run/elasticsearch/elasticsearch.pid' [ !! ] * ERROR: elasticsearch failed to start Despite this warning the daemon is actually started: ps wax | grep elasticsearch 24295 ? Sl 0:03 /usr/lib/jvm/oracle-jdk-bin-1.7/bin/java -Delasticsearch -Des.pidfile=/run/elasticsearch/elasticsearch.pid -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/elasticsearch-0.90.7.jar:/usr/share/elasticsearch/lib/*:/usr/share/elasticsearch/lib/sigar/* -Des.path.conf=/etc/elasticsearch -Des.path.data=/var/lib/elasticsearch/_default/data -Des.path.work=/var/lib/elasticsearch/_default/work -Des.path.logs=/var/log/elasticsearch/_default org.elasticsearch.bootstrap.ElasticSearch Changing the init script via the following patch makes this issue go away: --- elasticsearch 2013-11-15 12:34:11.000000000 +0000 +++ elasticsearch.fixed 2013-11-15 12:36:02.016740053 +0000 @@ -31,7 +31,7 @@ export ES_USE_IPV4 server_command="/usr/share/elasticsearch/bin/elasticsearch" -server_args=" -p ${PIDFILE} -Des.path.conf=\"${ES_CONF_PATH}\" -Des.path.data=\"${ES_DATA_PATH}\" -Des.path.work=\"${ES_WORK_PATH}\" -Des.path.logs=\"${ES_LOG_PATH}\"" +server_args=" -p ${PIDFILE} -f -Des.path.conf=\"${ES_CONF_PATH}\" -Des.path.data=\"${ES_DATA_PATH}\" -Des.path.work=\"${ES_WORK_PATH}\" -Des.path.logs=\"${ES_LOG_PATH}\"" depend() { use net @@ -71,6 +71,7 @@ checkpath -d -o "${ES_USER}" -m750 "${ES_LOG_PATH}" start-stop-daemon --start \ + --background \ --chdir "${ES_BASE_PATH}" \ --user="${ES_USER}" \ --pidfile="${PIDFILE}" \ Reproducible: Always
Created attachment 363322 [details, diff] Init script patch to fix error on starting elasticsearch
+*elasticsearch-0.90.6-r1 (27 Nov 2013) + + 27 Nov 2013; Tony Vroon <chainsaw@gentoo.org> + +elasticsearch-0.90.6-r1.ebuild, +files/elasticsearch.init2: + Have the init script work properly, fixes by Simon Alman. Closes bug #491324.