This repository has been archived by the owner on Nov 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 47f542a
Showing
35 changed files
with
840 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash -e | ||
|
||
PID_FILE=$OPENSHIFT_ELASTICSEARCH_DIR/run/elasticsearch.pid | ||
|
||
function _is_running() { | ||
if [ -f $PID_FILE ]; then | ||
zpid=$(cat $PID_FILE 2> /dev/null) | ||
myid=$(id -u) | ||
if `ps -opid,args --pid $zpid 2>&1 &> /dev/null`; then | ||
return 0 | ||
fi | ||
fi | ||
|
||
return 1 | ||
} | ||
|
||
function start() { | ||
if _is_running; then | ||
echo "ElasticSearch is already running" 1>&2 | ||
return 0 | ||
fi | ||
|
||
$OPENSHIFT_ELASTICSEARCH_DIR/usr/bin/elasticsearch -p $PID_FILE | ||
} | ||
|
||
function stop() { | ||
if ! _is_running; then | ||
echo "ElasticSearch is already stopped" 1>&2 | ||
return 0 | ||
fi | ||
|
||
if [ -f $PID_FILE ]; then | ||
zpid=$(cat $PID_FILE 2> /dev/null) | ||
fi | ||
|
||
if [ -n $zpid ]; then | ||
/bin/kill $zpid | ||
ret=$? | ||
if [ $ret -eq 0 ]; then | ||
TIMEOUT=10 | ||
while [ $TIMEOUT -gt 0 ] && _is_running ; do | ||
/bin/kill -0 "$zpid" > /dev/null 2>&1 || break | ||
sleep 1 | ||
let TIMEOUT=${TIMEOUT}-1 | ||
done | ||
fi | ||
fi | ||
} | ||
|
||
function restart() { | ||
stop | ||
start | ||
} | ||
|
||
function status() { | ||
if output=$(curl http://$OPENSHIFT_RUBY_IP:$OPENSHIFT_RUBY_PORT/ &> /dev/null); then | ||
client_result "Application is running" | ||
else | ||
client_result "Application is either stopped or inaccessible" | ||
fi | ||
} | ||
|
||
function threaddump() { | ||
} | ||
|
||
case "$1" in | ||
start) start ;; | ||
stop) stop ;; | ||
restart | reload ) restart $1 ;; | ||
status) status ;; | ||
threaddump) threaddump ;; | ||
*) exit 0 | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
mkdir -p $OPENSHIFT_ELASTICSEARCH_DIR/run $OPENSHIFT_DATA_DIR/elasticsearch |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ | ||
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ | ||
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/ | ||
!_TAG_PROGRAM_NAME Exuberant Ctags // | ||
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ | ||
!_TAG_PROGRAM_VERSION 5.8 // | ||
_is_running /Users/andy/Dropbox/openshift/openshift-elasticsearch-cartridge/bin/control /^function _is_running() {$/;" f language:Sh | ||
restart /Users/andy/Dropbox/openshift/openshift-elasticsearch-cartridge/bin/control /^function restart() {$/;" f language:Sh | ||
start /Users/andy/Dropbox/openshift/openshift-elasticsearch-cartridge/bin/control /^function start() {$/;" f language:Sh | ||
status /Users/andy/Dropbox/openshift/openshift-elasticsearch-cartridge/bin/control /^function status() {$/;" f language:Sh | ||
stop /Users/andy/Dropbox/openshift/openshift-elasticsearch-cartridge/bin/control /^function stop() {$/;" f language:Sh | ||
threaddump /Users/andy/Dropbox/openshift/openshift-elasticsearch-cartridge/bin/control /^function threaddump() {$/;" f language:Sh |
Oops, something went wrong.