diff --git a/utils/RUN_Server2Stop.sh b/utils/RUN_Server2Stop.sh index 49dd429e4e..c4ebc2f5dc 100644 --- a/utils/RUN_Server2Stop.sh +++ b/utils/RUN_Server2Stop.sh @@ -17,5 +17,5 @@ export JBOSS_SERVERLIB JBOSS_CLASSPATH=$ADEMPIERE_HOME/lib/jboss.jar:$JBOSS_LIB/jboss-system.jar: export JBOSS_CLASSPATH -echo shutdown.sh --server=jnp://$ADEMPIERE_APPS_SERVER:$ADEMPIERE_JNP_PORT -. $JBOSS_HOME/bin/shutdown.sh --server=jnp://$ADEMPIERE_APPS_SERVER:$ADEMPIERE_JNP_PORT --shutdown +echo sh $JBOSS_HOME/bin/shutdown.sh --server=jnp://$ADEMPIERE_APPS_SERVER:$ADEMPIERE_JNP_PORT --shutdown +sh $JBOSS_HOME/bin/shutdown.sh --server=jnp://$ADEMPIERE_APPS_SERVER:$ADEMPIERE_JNP_PORT --shutdown diff --git a/utils/unix/adempiere_Debian.sh b/utils/unix/adempiere_Debian.sh index 33fd92b4a4..a36749972b 100644 --- a/utils/unix/adempiere_Debian.sh +++ b/utils/unix/adempiere_Debian.sh @@ -17,8 +17,11 @@ # initialization # adjust these variables to your environment EXECDIR=/home/adempiere/Adempiere -ENVFILE=/home/adempiere/.bashrc ADEMPIEREUSER=adempiere +# Instead of using ENVFILE you can set JAVA_HOME, ADEMPIERE_HOME and add JAVA_HOME/bin to PATH +# in this case you can comment the source lines for ENVFILE below +# detected some problems with Hardy Heron ubuntu using the bash source command +ENVFILE=/home/adempiere/.bashrc . /lib/lsb/init-functions @@ -28,7 +31,7 @@ MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes) getadempierestatus() { ADEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $EXECDIR) - echo $ADEMPIERESTATUSSTRING | grep $EXECDIR &> /dev/null + echo $ADEMPIERESTATUSSTRING | grep -q $EXECDIR ADEMPIERESTATUS=$? } @@ -39,7 +42,7 @@ start () { return 1 fi echo -n "Starting ADempiere ERP: " - source $ENVFILE + . $ENVFILE export LOGFILE=$ADEMPIERE_HOME/jboss/server/adempiere/log/adempiere_`date +%Y%m%d%H%M%S`.log su $ADEMPIEREUSER -c "mkdir -p $ADEMPIERE_HOME/jboss/server/adempiere/log" su $ADEMPIEREUSER -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2.sh &> $LOGFILE &" @@ -50,7 +53,7 @@ start () { ITERATIONS=0 while [ $STATUSTEST -eq 0 ] ; do sleep 2 - tail -n 5 $LOGFILE | grep 'INFO.*\[Server\].*Started in' &> /dev/null && STATUSTEST=1 + tail -n 5 $LOGFILE | grep -q 'INFO.*\[Server\].*Started in' && STATUSTEST=1 echo -n "." ITERATIONS=`expr $ITERATIONS + 1` if [ $ITERATIONS -gt $MAXITERATIONS ] @@ -79,7 +82,7 @@ stop () { return 1 fi echo -n "Stopping ADempiere ERP: " - source $ENVFILE + . $ENVFILE export LASTLOG=`ls -t $ADEMPIERE_HOME/jboss/server/adempiere/log/adempiere_??????????????.log | head -1` su $ADEMPIEREUSER -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2Stop.sh &> /dev/null &" RETVAL=$? @@ -89,7 +92,7 @@ stop () { ITERATIONS=0 while [ $STATUSTEST -eq 0 ] ; do sleep 2 - tail -n 5 $LASTLOG | grep 'Halting VM' &> /dev/null && STATUSTEST=1 + tail -n 5 $LASTLOG | grep -q 'Halting VM' && STATUSTEST=1 echo -n "." ITERATIONS=`expr $ITERATIONS + 1` if [ $ITERATIONS -gt $MAXITERATIONS ]