Detected that when the server crashes because of Out Of Memory the init.d scripts are not able to terminate it properly / fix to look for the server using org.adempiere.server.application instead of the IDEMPIERE_HOME
This commit is contained in:
parent
9f9249869a
commit
d527b6279f
|
@ -39,7 +39,7 @@ esac
|
|||
# adjust these variables to your environment
|
||||
IDEMPIERE_USER=idempiere
|
||||
IDEMPIERE_HOME=/opt/idempiere-server
|
||||
JAVA_HOME=`ls -r /usr/lib/jvm/java-[678]-openjdk*/bin/javac /usr/lib/jvm/java-[8]-oracle*/bin/javac | head -1`
|
||||
JAVA_HOME=`ls -r /usr/lib/jvm/java-[6789]-openjdk*/bin/javac /usr/lib/jvm/java-[89]-oracle*/bin/javac | head -1`
|
||||
JAVA_HOME=`dirname $JAVA_HOME`
|
||||
JAVA_HOME=`dirname $JAVA_HOME`
|
||||
SU=su
|
||||
|
@ -533,8 +533,8 @@ Enter postgres password:"
|
|||
}
|
||||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep ${IDEMPIERE_HOME})
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep org.adempiere.server.application | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q org.adempiere.server.application
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -626,14 +626,14 @@ stop () {
|
|||
log_success_msg "Service stopped with OSGi shutdown"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
log_success_msg "Service stopped with kill -15"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -664,7 +664,7 @@ dostatus () {
|
|||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo
|
||||
echo "iDempiere is running:"
|
||||
ps ax | grep -v grep | grep ${IDEMPIERE_HOME} | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
ps ax | grep org.adempiere.server.application | grep -v grep | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo
|
||||
else
|
||||
echo "iDempiere is stopped"
|
||||
|
|
|
@ -32,8 +32,8 @@ IDEMPIERESTATUS=
|
|||
MAXITERATIONS=60
|
||||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $IDEMPIERE_HOME)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $IDEMPIERE_HOME
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep org.adempiere.server.application | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q org.adempiere.server.application
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -96,14 +96,14 @@ stop () {
|
|||
log_success_msg "Service stopped with OSGi shutdown"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
log_success_msg "Service stopped with kill -15"
|
||||
else
|
||||
log_warning_msg "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -118,7 +118,7 @@ stop () {
|
|||
|
||||
restart () {
|
||||
stop
|
||||
sleep 1
|
||||
sleep 2
|
||||
start
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ status () {
|
|||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo
|
||||
echo "iDempiere is running:"
|
||||
ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
ps ax | grep org.adempiere.server.application | grep -v grep | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo
|
||||
else
|
||||
echo "iDempiere is stopped"
|
||||
|
|
|
@ -25,11 +25,11 @@ IDEMPIEREUSER=idempiere
|
|||
|
||||
RETVAL=0
|
||||
IDEMPIERESTATUS=
|
||||
MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes)
|
||||
MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes
|
||||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $IDEMPIERE_HOME)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $IDEMPIERE_HOME
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep org.adempiere.server.application | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q org.adempiere.server.application
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ start () {
|
|||
stop () {
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
echo "idempiere is already stopped"
|
||||
echo "iDempiere is already stopped"
|
||||
return 1
|
||||
fi
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
|
@ -92,14 +92,14 @@ stop () {
|
|||
echo_success
|
||||
else
|
||||
echo "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
echo_success
|
||||
else
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -130,11 +130,11 @@ status () {
|
|||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo
|
||||
echo "idempiere is running:"
|
||||
ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo "iDempiere is running:"
|
||||
ps ax | grep org.adempiere.server.application | grep -v grep | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo
|
||||
else
|
||||
echo "idempiere is stopped"
|
||||
echo "iDempiere is stopped"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ IDEMPIERESTATUS=
|
|||
MAXITERATIONS=60
|
||||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $IDEMPIERE_HOME)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $IDEMPIERE_HOME
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep java | grep org.adempiere.server.application | grep -v grep)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q org.adempiere.server.application
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -123,14 +123,14 @@ stop () {
|
|||
echo "Service stopped with OSGi shutdown"
|
||||
else
|
||||
echo "Trying direct kill with signal -15"
|
||||
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -15 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
echo "Service stopped with kill -15"
|
||||
else
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
kill -9 -`ps ax o pgid,command | grep org.adempiere.server.application | grep -v grep | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -146,7 +146,7 @@ stop () {
|
|||
|
||||
restart () {
|
||||
stop
|
||||
sleep 1
|
||||
sleep 2
|
||||
start
|
||||
rc_status
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ status () {
|
|||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo
|
||||
echo "iDempiere is running:"
|
||||
ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
ps ax | grep org.adempiere.server.application | grep -v grep | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo
|
||||
else
|
||||
echo "iDempiere is stopped"
|
||||
|
@ -182,9 +182,6 @@ case "$1" in
|
|||
stop)
|
||||
stop
|
||||
;;
|
||||
reload)
|
||||
restart
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
|
@ -195,7 +192,7 @@ case "$1" in
|
|||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|reload|restart|condrestart|status}"
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in New Issue