Fixed setup and installation script.
This commit is contained in:
parent
61e6324fee
commit
bafafa3239
|
@ -58,10 +58,6 @@
|
|||
<copy file="utils/myEnvironmentTemplate.bat"
|
||||
tofile="utils/myEnvironment.bat" filtering="yes" overwrite="yes" />
|
||||
|
||||
<copy file="utils/RUN_GetAdempiereTemplate.bat"
|
||||
tofile="utils/RUN_GetAdempiere.bat" filtering="yes" overwrite="yes" />
|
||||
<copy file="utils/RUN_PutExportTemplate.bat"
|
||||
tofile="utils/RUN_PutExport.bat" filtering="yes" overwrite="yes" />
|
||||
<copy file="utils/RUN_WinEnvTemplate.bat"
|
||||
tofile="utils/RUN_WinEnv.bat" filtering="yes" overwrite="yes" />
|
||||
|
||||
|
@ -86,10 +82,6 @@
|
|||
<copy file="utils/myEnvironmentTemplate.sh"
|
||||
tofile="utils/myEnvironment.sh" filtering="yes" overwrite="yes" />
|
||||
|
||||
<copy file="utils/RUN_GetAdempiereTemplate.sh"
|
||||
tofile="utils/RUN_GetAdempiere.sh" filtering="yes" overwrite="yes" />
|
||||
<copy file="utils/RUN_PutExportTemplate.sh"
|
||||
tofile="utils/RUN_PutExport.sh" filtering="yes" overwrite="yes" />
|
||||
<copy file="utils/RUN_UnixEnvTemplate.sh"
|
||||
tofile="utils/RUN_UnixEnv.sh" filtering="yes" overwrite="yes" />
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ goto START
|
|||
|
||||
:START
|
||||
@REM Setup idempiere.properties and idempiereEnv.properties
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -clean -noRegistryCache -application org.adempiere.install.console-application
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.adempiere.install.console-application
|
||||
|
||||
@Echo ErrorLevel = %ERRORLEVEL%
|
||||
@IF NOT ERRORLEVEL = 1 GOTO NEXT
|
||||
|
@ -30,7 +30,7 @@ goto START
|
|||
|
||||
:NEXT
|
||||
@REM setup tomcat
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -clean -noRegistryCache -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
@Echo .
|
||||
@Echo For problems, check log file in base directory
|
||||
|
|
|
@ -16,10 +16,10 @@ fi
|
|||
|
||||
|
||||
# Setup idempiere.properties and idempiereEnv.properties
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -application org.adempiere.install.console-application
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.adempiere.install.console-application
|
||||
|
||||
# Setup Tomcat
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
echo ===================================
|
||||
echo Make .sh executable & set Env
|
||||
|
|
|
@ -17,4 +17,4 @@ goto START
|
|||
@Echo Starting iDempiere Server ...
|
||||
@Echo =======================================
|
||||
|
||||
@"%JAVA%" -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -console -application org.adempiere.server.application
|
||||
@"%JAVA%" -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.*.jar -console 12612 -application org.adempiere.server.application
|
||||
|
|
|
@ -13,4 +13,4 @@ echo ===================================
|
|||
echo Starting iDempiere Server
|
||||
echo ===================================
|
||||
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -console -application org.adempiere.server.application
|
||||
$JAVA -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.*.jar -console 12612 -application org.adempiere.server.application
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</configIni>
|
||||
|
||||
<launcherArgs>
|
||||
<programArgs>-console --launcher.XXMaxPermSize 192m</programArgs>
|
||||
<programArgs>-console 12612 --launcher.XXMaxPermSize 192m</programArgs>
|
||||
<vmArgs>-Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true</vmArgs>
|
||||
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
|
||||
</launcherArgs>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -18,7 +18,7 @@ goto START
|
|||
|
||||
:START
|
||||
@REM Setup idempiere.properties and idempiereEnv.properties
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -application org.adempiere.install.application -consoleLog
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.adempiere.install.application -consoleLog
|
||||
|
||||
@Echo ErrorLevel = %ERRORLEVEL%
|
||||
@IF NOT ERRORLEVEL = 1 GOTO NEXT
|
||||
|
@ -31,7 +31,7 @@ goto START
|
|||
:NEXT
|
||||
@REM setup tomcat
|
||||
@Echo ... Setup Tomcat
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
@Echo ...
|
||||
@Echo For problems, check log file in base directory
|
||||
|
|
|
@ -15,11 +15,11 @@ else
|
|||
fi
|
||||
|
||||
#setup idempiere.properties and idempiereEnv.propertiess
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -application org.adempiere.install.application -consoleLog
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.adempiere.install.application -consoleLog
|
||||
|
||||
echo ... Setup Tomcat
|
||||
#setup tomcat
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
echo ... Make .sh executable
|
||||
chmod -R a+x *.sh
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/sh
|
||||
# iDempiere Server Start
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
fi
|
||||
|
||||
. ./myEnvironment.sh Server
|
||||
|
||||
## Check Java Home
|
||||
if [ $JAVA_HOME ]; then
|
||||
JAVA=$JAVA_HOME/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
echo JAVA_HOME is not set.
|
||||
echo You may not be able to start Adempiere
|
||||
echo Set JAVA_HOME to the directory of your local JDK.
|
||||
fi
|
||||
|
||||
# To use your own Encryption class (implementing org.compiere.util.SecureInterface),
|
||||
# you need to set it here (and in the client start script) - example:
|
||||
# SECURE=-DADEMPIERE_SECURE=org.compiere.util.Secure
|
||||
SECURE=
|
||||
|
||||
VMARGS="-Dosgi.compatibility.bootdelegation=true -Djava.awt.headless=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -DIDEMPIERE_HOME=$IDEMPIERE_HOME"
|
||||
# headless option if you don't have X installed on the server
|
||||
$JAVA -server $VMARGS -jar $IDEMPIERE_HOME/osgi/org.eclipse.osgi_3.6.0.v20100517.jar -install $IDEMPIERE_HOME/osgi -configuration $IDEMPIERE_HOME/osgi/server -clean -console
|
||||
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh
|
||||
# ADempiere Server Stop script
|
||||
|
||||
if [ $IDEMPIERE_HOME ]; then
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
fi
|
||||
|
||||
. ./myEnvironment.sh Server
|
||||
echo Adempiere Server Stop - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
|
||||
|
||||
JBOSS_LIB=$JBOSS_HOME/lib
|
||||
export JBOSS_LIB
|
||||
JBOSS_SERVERLIB=$JBOSS_HOME/server/adempiere/lib
|
||||
export JBOSS_SERVERLIB
|
||||
JBOSS_CLASSPATH=$IDEMPIERE_HOME/lib/jboss.jar:$JBOSS_LIB/jboss-system.jar:
|
||||
export JBOSS_CLASSPATH
|
||||
|
||||
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
|
|
@ -42,7 +42,7 @@ StartService ()
|
|||
ConsoleMessage "Starting iDempiere ERP: "
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
export LOOKFILE=$IDEMPIERE_HOME/server.log
|
||||
su root -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2.sh &> $LOGFILE &"
|
||||
su root -c "cd $EXECDIR;$EXECDIR/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
# wait for server to be confirmed as started in logfile
|
||||
|
@ -58,7 +58,7 @@ StartService ()
|
|||
fi
|
||||
done
|
||||
|
||||
if [ $STATUSTEST -eq 0 ]
|
||||
if [ $STATUSTEST -eq 0 ]
|
||||
then
|
||||
ConsoleMessage "Service hasn't started within the timeout allowed, please review file $LOGFILE to see the status of the service"
|
||||
else
|
||||
|
@ -80,36 +80,25 @@ StopService()
|
|||
return 1
|
||||
fi
|
||||
ConsoleMessage "Stopping iDempiere ERP: "
|
||||
export LASTLOG=`ls -t $IDEMPIERE_HOME/log/idempiere_??????????????.log | head -1`
|
||||
export LOOKFILE=$IDEMPIERE_HOME/log/server.log
|
||||
su root -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2Stop.sh &> /dev/null &"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
# wait for server to be confirmed as halted in logfile
|
||||
STATUSTEST=0
|
||||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
tail -n 5 $LOOKFILE | grep 'Shutdown complete' &> /dev/null && STATUSTEST=1
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ $STATUSTEST -eq 0 ]
|
||||
then
|
||||
ConsoleMessage "Service hasn't stopped within the timeout allowed, please review file $LASTLOG to see the status of the service"
|
||||
# try direct kill with signal 15, then signal 9
|
||||
kill -15 `ps ax | grep -v grep | grep $EXECDIR | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
sleep 5
|
||||
IDEMPIERESTATUS=$(ps ax | grep -v grep | grep server| grep $EXECDIR|wc -l)
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
ConsoleMessage "Service stopped with kill -15"
|
||||
else
|
||||
ConsoleMessage "idempiere Stopped"
|
||||
fi
|
||||
echo
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 `ps ax | grep -v grep | grep $EXECDIR | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
sleep 5
|
||||
IDEMPIERESTATUS=$(ps ax | grep -v grep | grep server| grep $EXECDIR|wc -l)
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
ConsoleMessage "Service stopped with kill -9"
|
||||
else
|
||||
ConsoleMessage "idempiere Failed to Stop"
|
||||
echo
|
||||
ConsoleMessage "Service hasn't stopped"
|
||||
fi
|
||||
fi
|
||||
return $RETVAL
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,24 +18,22 @@
|
|||
|
||||
# initialization
|
||||
# adjust these variables to your environment
|
||||
EXECDIR=/opt/idempiere/iDempiere
|
||||
IDEMPIERE_HOME=/home/idempiere/idempiere-server
|
||||
IDEMPIEREUSER=idempiere
|
||||
# Instead of using ENVFILE you can set JAVA_HOME, IDEMPIERE_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/idempiere/.bashrc
|
||||
# STOPMESSAGE="Halting VM" # Message when using java 5
|
||||
STOPMESSAGE="INFO.*Server\].*Shutdown complete" # Message when using java 6
|
||||
ENVFILE=$IDEMPIERE_HOME/utils/myEnvironment.sh
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
RETVAL=0
|
||||
IDEMPIERESTATUS=
|
||||
MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes)
|
||||
MAXITERATIONS=60
|
||||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $EXECDIR)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $EXECDIR
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $IDEMPIERE_HOME)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $IDEMPIERE_HOME
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
|
@ -46,10 +44,11 @@ start () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Starting iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
. $ENVFILE
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
su $IDEMPIEREUSER -c "mkdir -p IDEMPIERE_HOME/log"
|
||||
su $IDEMPIEREUSER -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2.sh &> $LOGFILE &"
|
||||
su $IDEMPIEREUSER -c "cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
# wait for server to be confirmed as started in logfile
|
||||
|
@ -57,7 +56,7 @@ start () {
|
|||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
tail -n 9 $LOGFILE | grep -q 'INFO.*\[Server\].*Started in' && STATUSTEST=1
|
||||
tail -n 9 $LOGFILE | grep -q '.*WebUIServlet.*started successfully.*' && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
|
@ -76,6 +75,7 @@ start () {
|
|||
log_failure_msg "Service not started"
|
||||
echo
|
||||
fi
|
||||
RETVAL=$?
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
|
@ -86,38 +86,18 @@ stop () {
|
|||
return 1
|
||||
fi
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
cd $IDEMPIERE_HOME/utils
|
||||
. $ENVFILE
|
||||
# export LASTLOG=`ls -t $IDEMPIERE_HOME/log/adempiere_??????????????.log | head -1`
|
||||
export LASTLOG=$IDEMPIERE_HOME/adempiere/log/server.log
|
||||
su $IDEMPIEREUSER -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2Stop.sh &> /dev/null &"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
# wait for server to be confirmed as halted in logfile
|
||||
STATUSTEST=0
|
||||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
tail -n 9 $LASTLOG | grep -q "$STOPMESSAGE" && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ $STATUSTEST -eq 0 ]
|
||||
then
|
||||
log_warning_msg "Service hasn't stopped within the timeout allowed, please review file $LASTLOG to see the status of the service"
|
||||
log_warning_msg "Trying direct kill with signal -15"
|
||||
# idempiere didn't finish - try direct kill with signal 15, then signal 9
|
||||
kill -15 `ps ax | grep -v grep | grep $EXECDIR | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
# try direct kill with signal 15, then signal 9
|
||||
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
log_success_msg "Service stopped with kill -15"
|
||||
else
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 `ps ax | grep -v grep | grep $EXECDIR | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -126,14 +106,6 @@ stop () {
|
|||
log_warning_msg "Service hasn't stopped"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
log_success_msg "Service stopped"
|
||||
fi
|
||||
echo
|
||||
else
|
||||
log_failure_msg "Service not stopped"
|
||||
echo
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
|
@ -150,12 +122,12 @@ condrestart () {
|
|||
fi
|
||||
}
|
||||
|
||||
rhstatus () {
|
||||
status () {
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo
|
||||
echo "iDempiere is running:"
|
||||
ps ax | grep -v grep | grep $EXECDIR | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo
|
||||
else
|
||||
echo "iDempiere is stopped"
|
||||
|
@ -179,7 +151,7 @@ case "$1" in
|
|||
condrestart
|
||||
;;
|
||||
status)
|
||||
rhstatus
|
||||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|reload|restart|condrestart|status}"
|
||||
|
|
|
@ -17,11 +17,9 @@
|
|||
|
||||
# initialization
|
||||
# adjust these variables to your environment
|
||||
EXECDIR=/home/idempiere/iDempiere
|
||||
ENVFILE=/home/idempiere/.bash_profile
|
||||
IDEMPIERE_HOME=/home/idempiere/idempiere-server
|
||||
ENVFILE=$IDEMPIERE_HOME/utils/myEnvironment.sh
|
||||
IDEMPIEREUSER=idempiere
|
||||
# STOPMESSAGE="Halting VM" # Message when using java 5
|
||||
STOPMESSAGE="INFO.*Server\].*Shutdown complete" # Message when using java 6
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
|
@ -30,22 +28,22 @@ IDEMPIERESTATUS=
|
|||
MAXITERATIONS=60 # 2 seconds every iteration, max wait 2 minutes)
|
||||
|
||||
getidempierestatus() {
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $EXECDIR)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $EXECDIR
|
||||
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep $IDEMPIERE_HOME)
|
||||
echo $IDEMPIERESTATUSSTRING | grep -q $IDEMPIERE_HOME
|
||||
IDEMPIERESTATUS=$?
|
||||
}
|
||||
|
||||
start () {
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo "idempiere is already running"
|
||||
echo "iDempiere is already running"
|
||||
return 1
|
||||
fi
|
||||
echo -n "Starting ADempiere ERP: "
|
||||
source $ENVFILE
|
||||
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
|
||||
su $IDEMPIEREUSER -c "mkdir -p $IDEMPIERE_HOME/log"
|
||||
su $IDEMPIEREUSER -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2.sh &> $LOGFILE &"
|
||||
su $IDEMPIEREUSER -c "cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
# wait for server to be confirmed as started in logfile
|
||||
|
@ -53,7 +51,7 @@ start () {
|
|||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
tail -n 9 $LOGFILE | grep -q 'INFO.*\[Server\].*Started in' && STATUSTEST=1
|
||||
tail -n 9 $LOGFILE | grep -q '.*WebUIServlet.*started successfully.*' && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
|
@ -82,39 +80,18 @@ stop () {
|
|||
echo "idempiere is already stopped"
|
||||
return 1
|
||||
fi
|
||||
echo -n "Stopping ADempiere ERP: "
|
||||
echo -n "Stopping iDempiere ERP: "
|
||||
source $ENVFILE
|
||||
# export LASTLOG=`ls -t $IDEMPIERE_HOME/log/idempiere_??????????????.log | head -1`
|
||||
export LASTLOG=$IDEMPIERE_HOME/log/server.log
|
||||
su $IDEMPIEREUSER -c "cd $EXECDIR/utils;$EXECDIR/utils/RUN_Server2Stop.sh &> /dev/null &"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
# wait for server to be confirmed as halted in logfile
|
||||
STATUSTEST=0
|
||||
ITERATIONS=0
|
||||
while [ $STATUSTEST -eq 0 ] ; do
|
||||
sleep 2
|
||||
tail -n 9 $LASTLOG | grep -q "$STOPMESSAGE" && STATUSTEST=1
|
||||
echo -n "."
|
||||
ITERATIONS=`expr $ITERATIONS + 1`
|
||||
if [ $ITERATIONS -gt $MAXITERATIONS ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ $STATUSTEST -eq 0 ]
|
||||
then
|
||||
echo "Service hasn't stopped within the timeout allowed, please review file $LASTLOG to see the status of the service"
|
||||
echo "Trying direct kill with signal -15"
|
||||
# Adempiere didn't finish - try direct kill with signal 15, then signal 9
|
||||
kill -15 `ps ax | grep -v grep | grep $EXECDIR | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
kill -15 `ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
echo_success
|
||||
else
|
||||
echo "Trying direct kill with signal -9"
|
||||
kill -9 `ps ax | grep -v grep | grep $EXECDIR | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
kill -9 `ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " "`
|
||||
sleep 5
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -ne 0 ] ; then
|
||||
|
@ -123,14 +100,7 @@ stop () {
|
|||
echo_warning
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo_success
|
||||
fi
|
||||
echo
|
||||
else
|
||||
echo_failure
|
||||
echo
|
||||
fi
|
||||
RETVAL=$?
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
|
@ -147,12 +117,12 @@ condrestart () {
|
|||
fi
|
||||
}
|
||||
|
||||
rhstatus () {
|
||||
status () {
|
||||
getidempierestatus
|
||||
if [ $IDEMPIERESTATUS -eq 0 ] ; then
|
||||
echo
|
||||
echo "idempiere is running:"
|
||||
ps ax | grep -v grep | grep $EXECDIR | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
ps ax | grep -v grep | grep $IDEMPIERE_HOME | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
|
||||
echo
|
||||
else
|
||||
echo "idempiere is stopped"
|
||||
|
@ -176,7 +146,7 @@ case "$1" in
|
|||
condrestart
|
||||
;;
|
||||
status)
|
||||
rhstatus
|
||||
status
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|reload|restart|condrestart|status}"
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
@if (%IDEMPIERE_HOME%) == () (CALL myEnvironment.bat Server) else (CALL %IDEMPIERE_HOME%\utils\myEnvironment.bat Server)
|
||||
@Title Adempiere Server Start - %IDEMPIERE_HOME% (%ADEMPIERE_APPS_TYPE%)
|
||||
|
||||
@Rem $Id: RUN_Server2.bat,v 1.24 2005/10/26 00:38:18 jjanke Exp $
|
||||
|
||||
:CHECK_JAVA:
|
||||
@if not "%JAVA_HOME%" == "" goto JAVA_HOME_OK
|
||||
@Set JAVA=java
|
||||
@Echo JAVA_HOME is not set.
|
||||
@Echo You may not be able to start Adempiere
|
||||
@Echo Set JAVA_HOME to the directory of your local JDK.
|
||||
@Echo You could set it via WinEnv.js e.g.:
|
||||
@Echo cscript WinEnv.js C:\Adempiere C:\j2sdk1.4.2_06
|
||||
@goto CHECK_ADEMPIERE
|
||||
:JAVA_HOME_OK
|
||||
@Set JAVA=%JAVA_HOME%\bin\java
|
||||
|
||||
@Rem To use your own Encryption class (implementing org.compiere.util.SecureInterface),
|
||||
@Rem you need to set it here (and in the client start script) - example:
|
||||
@Rem SET SECURE=-DADEMPIERE_SECURE=org.compiere.util.Secure
|
||||
@SET SECURE=
|
||||
|
||||
VMARGS="-Dosgi.compatibility.bootdelegation=true -Djava.awt.headless=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -DIDEMPIERE_HOME=%IDEMPIERE_HOME%"
|
||||
# headless option if you don't have X installed on the server
|
||||
@"%JAVA%" -server %VMARGS% -jar %IDEMPIERE_HOME%/osgi/org.eclipse.osgi_3.6.0.v20100517.jar -install %IDEMPIERE_HOME%/osgi -configuration %IDEMPIERE_HOME%/osgi/server -clean -console
|
|
@ -1,28 +0,0 @@
|
|||
@if (%IDEMPIERE_HOME%) == () (CALL myEnvironment.bat Server) else (CALL %IDEMPIERE_HOME%\utils\myEnvironment.bat Server)
|
||||
@Title Adempiere Server Stop - %IDEMPIERE_HOME%
|
||||
|
||||
@Rem $Id: RUN_Server2Stop.bat,v 1.12 2005/09/06 02:46:16 jjanke Exp $
|
||||
|
||||
@IF '%ADEMPIERE_APPS_TYPE%' == 'jboss' GOTO JBOSS
|
||||
@GOTO UNSUPPORTED
|
||||
|
||||
:JBOSS
|
||||
@Set NOPAUSE=Yes
|
||||
@Set JBOSS_LIB=%JBOSS_HOME%\lib
|
||||
@Set JBOSS_SERVERLIB=%JBOSS_HOME%\server\adempiere\lib
|
||||
@Set JBOSS_CLASSPATH=%IDEMPIERE_HOME%\lib\jboss.jar;%JBOSS_LIB%\jboss-system.jar
|
||||
|
||||
@CD %JBOSS_HOME%\bin
|
||||
Call shutdown --server=jnp://%ADEMPIERE_APPS_SERVER%:%ADEMPIERE_JNP_PORT% --shutdown
|
||||
|
||||
@Echo Done Stopping Adempiere Apps Server %IDEMPIERE_HOME% (%ADEMPIERE_DB_NAME%)
|
||||
@GOTO END
|
||||
|
||||
:UNSUPPORTED
|
||||
@Echo Apps Server stop of %ADEMPIERE_APPS_TYPE% not supported
|
||||
|
||||
:END
|
||||
@Rem Sleep 30
|
||||
@CHOICE /C YN /T 30 /D N > NUL
|
||||
|
||||
@Exit
|
|
@ -1,9 +0,0 @@
|
|||
@if (%IDEMPIERE_HOME%) == () (CALL myEnvironment.bat Server) else (CALL %IDEMPIERE_HOME%\utils\myEnvironment.bat Server)
|
||||
@Title Start Adempiere - %IDEMPIERE_HOME% (%ADEMPIERE_DB_NAME%)
|
||||
|
||||
@Rem $Id: RUN_Start.bat,v 1.11 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
@Echo Starting Database
|
||||
@CALL %ADEMPIERE_DB_PATH%\Start.bat
|
||||
|
||||
@START %IDEMPIERE_HOME%\utils\RUN_Server2.bat
|
|
@ -1,9 +0,0 @@
|
|||
@if (%IDEMPIERE_HOME%) == () (CALL myEnvironment.bat Server) else (CALL %IDEMPIERE_HOME%\utils\myEnvironment.bat Server)
|
||||
@Title Stop Adempiere - %IDEMPIERE_HOME% (%ADEMPIERE_DB_NAME%)
|
||||
|
||||
@Rem $Id: RUN_Stop.bat,v 1.11 2005/01/22 21:59:15 jjanke Exp $
|
||||
|
||||
@CALL %IDEMPIERE_HOME%\utils\RUN_Server2Stop.bat
|
||||
|
||||
@CALL %ADEMPIERE_DB_PATH%\Stop.bat
|
||||
|
|
@ -4,5 +4,5 @@ REM Adempiere_Service_Uninstall.bat - globalqss - based on http://javaservice.ob
|
|||
|
||||
if (%IDEMPIERE_HOME%) == () (CALL myEnvironment.bat Server) else (CALL %IDEMPIERE_HOME%\utils\myEnvironment.bat Server)
|
||||
|
||||
NET STOP Adempiere
|
||||
%IDEMPIERE_HOME%\utils\windows\AdempiereService.exe -uninstall Adempiere
|
||||
NET STOP idempiere
|
||||
%IDEMPIERE_HOME%\utils\windows\idempiereService.exe -uninstall idempiere
|
||||
|
|
Loading…
Reference in New Issue