Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 491324 - app-misc/elasticsearch - init script starts daemon but start-stop-daemon detects it as failed
Summary: app-misc/elasticsearch - init script starts daemon but start-stop-daemon dete...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-11-15 12:38 UTC by Simon Alman
Modified: 2013-11-27 13:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Init script patch to fix error on starting elasticsearch (elasticsearch.patch,787 bytes, patch)
2013-11-15 12:41 UTC, Simon Alman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Alman 2013-11-15 12:38:42 UTC
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
Comment 1 Simon Alman 2013-11-15 12:41:35 UTC
Created attachment 363322 [details, diff]
Init script patch to fix error on starting elasticsearch
Comment 2 Tony Vroon (RETIRED) gentoo-dev 2013-11-27 13:44:17 UTC
+*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.