LOCKFILE in Integrationserver folder

Hi All,

i have sucessfully installed webmethod 8 Suite in win server 2008 and win server 2003, i have installed integration server as a service(services.msc) set the property has automatic, i have started the IS service from services.msc, after some time i have re-booted win server 2008.Observed the IS services is not started automatically, than i was trying to start manually it is given lock file exist .

than i have removed lock file and started the IS service from services.msc.

Observation:while re-booting win server 2008, IS lock file is not removing automatically, becz of this IS is not starting automatically.

is there any -way to resolve this problem.

regards,
anil kumar ellendula

you can create a windows restart script. in the script, stop the WM IS service before shut down the OS.

wht is the script i need to write and where i need to keep this file in windows OS Level, i observed that if shut down the win server and start the win server ,lock file is not removing.

Note: ihve installed IS as a Service level and StartType as Automatic.

I wrote a *.bat in C:
Inside the file I put del C:\webMethods7\IntegrationServer\LOCKFILE and then created a windows task to execute the bat file every system start.

Regards

Anil,

Alternatively, you can add this line to your “server.bat” file itself.

[INDENT]

 
if exist ..\LOCKFILE del ..\LOCKFILE

[/INDENT]But dont forget to take a backup of the server.bat file before you make changes to it.

thanks for reply all

suren: the script code you sent it is already in server.bat file by default.

Seee Below script of server.bat

@echo off

rem ###########################################################################
rem #
rem server.bat : launch webMethods Integration Server #
rem #
rem Change IS_DIR and JAVA_DIR to reflect their locations on your system #
rem #
rem This script is designed to work with Java VMs that conform to the #
rem command-line conventions of Sun Microsystems ™ Java Development Kit #
rem or Java Runtime Environment. #
rem #
rem ###########################################################################

SETLOCAL

rem … Be careful with changes below this line

SET IS_DIR=C:\webmethods80\IntegrationServer

call “%IS_DIR%\bin\setenv.bat”

rem Globalization support
set WM_HOME=%IS_DIR%…

set USE_80_AUDIT_TBLS="-Dcom.webmethods.sc.auditing.Use80TableFormat=true"

rem Set default XPathFactory implementation when running as service.
set XPATH_IMPL=-Djavax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
set ALLOW_ARRAY_CLASSLOADING="-Dsun.lang.ClassLoader.allowArraySyntax=true"

set JAVA_MEMSET=-Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -XX:MaxPermSize=%JAVA_MAX_PERM_SIZE%
set JAVA2_MEMSET=-Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -XX:MaxPermSize=%JAVA_MAX_PERM_SIZE% -Xrs %XPATH_IMPL% %ALLOW_ARRAY_CLASSLOADING% %USE_80_AUDIT_TBLS% -DWM_HOME="%WM_HOME%"

set CP_SWITCH=-cp
if exist “%JAVA_DIR%\bin\jre.exe” (
set JAVA_EXE="%JAVA_DIR%\bin\jre.exe"
set JAVA_CP="%JAVA_DIR%\lib\classes.zip;%JAVA_DIR%\lib\i18n.jar"
) else (
set JAVA_EXE="%JAVA_DIR%\bin\java.exe"
set JAVA_CP="%JAVA_DIR%\lib\rt.jar;%JAVA_DIR%\lib\i18n.jar"
)

set JVM_TYPE=sun

set JAVA_RUN=%JAVA_EXE% %JAVA_MEMSET% -server

set SAVED_CP=%CLASSPATH%
set SAVED_PATH=%PATH%

SET USE_ENV_CLASSPATH=true
SET ENV_CLASSPATH=
if %USE_ENV_CLASSPATH%==true (
set ENV_CLASSPATH=%SAVED_CP%
)

set IS_PROXY_MAIN=com.wm.app.server.Main
set IS_PROXY_JAR="%IS_DIR%\lib\wm-isproxy.jar"
set WM_CONVERTERS_JAR="%WM_HOME%\common\lib\wm-converters.jar"
set PREPENDCLASSES_SWITCH=-pcp
set APPENDCLASSES_SWITCH=-acp
set ENV_CLASSPATH_SWITCH=-ecp

:start

rem … server must start in install directory
cd /d “%IS_DIR%”

if exist LOCKFILE (
echo Only one Integration Server instance may be run from a particular
echo installation at a time. Make sure that this server is shutdown
echo before trying to start it. If no server is running, then
echo delete the file
echo %IS_DIR%\LOCKFILE
echo and try to start the server again.
goto :EOF
)
echo. > LOCKFILE

rem back up ini.cnf or restore if missing
if exist bin\ini.cnf copy /y bin\ini.cnf bin\ini.cnf.bak > nul
if not exist bin\ini.cnf copy /y bin\ini.cnf.bak bin\ini.cnf > nul

set PATH=%SAVED_PATH%
set CLASSPATH=%JAVA_CP%;%IS_PROXY_JAR%;%WM_CONVERTERS_JAR%

rem SSL support
set PATH=%PATH%;%IS_DIR%…\common\bin

rem
rem look for native packages: update path as needed
rem native packages contain DLLs that must be added to the path
rem in order to be dynamically loaded by the VM.
rem
for /D %%D in (packages*) do call :updatePackageInfo %%D

rem
rem append caching configuration directory to the classpath
rem
call :appendClasspath “%IS_DIR%”\config\Caching

set CLASSPATH=%PREPEND_SYSTEM_CLASSPATH%;%CLASSPATH%;%APPEND_SYSTEM_CLASSPATH%
set PATH=%PATH%;%IS_DIR%\support\win32;%JAVA_DIR%\bin\server;%IS_DIR%\lib;

rem
rem Run as an NT service ? If so, save program arguments to Registry
rem
if “1%1”==“1-service” (
if exist LOCKFILE del LOCKFILE
“%IS_DIR%\bin\SaveSvcParams.exe” /svcname %2 /jvm “%JAVA_DIR%…” /binpath “%PATH%” /classpath %CLASSPATH% /jvmargs “%JAVA2_MEMSET%” /progargs “%IS_DIR%\bin\ini.cnf”#"-service %2"#%PREPENDCLASSES_SWITCH%#%PREPENDCLASSES%#%APPENDCLASSES_SWITCH%#%APPENDCLASSES%#%ENV_CLASSPATH_SWITCH%#%ENV_CLASSPATH%#%3#%4#%5#%6#%7#%8#%9
goto :EOF
)

rem run integration server
title webMethods Integration Server
%JAVA_RUN% -DWM_HOME="%WM_HOME%" %USE_80_AUDIT_TBLS% %ALLOW_ARRAY_CLASSLOADING% -classpath %CLASSPATH% %IS_PROXY_MAIN% “%IS_DIR%”\bin\ini.cnf %PREPENDCLASSES_SWITCH% %PREPENDCLASSES% %APPENDCLASSES_SWITCH% %APPENDCLASSES% %ENV_CLASSPATH_SWITCH% %ENV_CLASSPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
set EL=%ERRORLEVEL%

if exist LOCKFILE del LOCKFILE

if “%EL%”==“42” goto start

rem
rem … restore original classpath and path
set CLASSPATH=%SAVED_CP%
set PATH=%SAVED_PATH%

ENDLOCAL

goto :EOF

:updatePackageInfo
if not exist %1\code\libs goto :EOF
call :prependToPath %1\code\libs
goto :EOF

:prependToPath
set PATH=%1;%PATH%
goto :EOF

:appendClasspath
set CLASSPATH=%CLASSPATH%;%1
goto :EOF

Anil: Hope you are not referring to the above code coz that’s just echo statements to print the message to the console.

The above two snippets would not be executed because of the use of got:EOF statement at the end of the first snippet. goto :EOF takes the control to the end of the script and ends the execution of the script.

So if at all you are adding the command, it should be added above the first check(if).

if do like rem of if exist LOCKFILE (goto :EOF
)
it is o.k ,

like

rem if exist LOCKFILE (
echo Only one Integration Server instance may be run from a particular
echo installation at a time. Make sure that this server is shutdown
echo before trying to start it. If no server is running, then
echo delete the file
echo %IS_DIR%\LOCKFILE
echo and try to start the server again.
rem goto :EOF
rem )

is it o.k, becs below it has

if “1%1”==“1-service” (
if exist LOCKFILE del LOCKFILE
“%IS_DIR%\bin\SaveSvcParams.exe” /svcname %2 /jvm “%JAVA_DIR%…” /binpath “%PATH%” /classpath %CLASSPATH% /jvmargs “%JAVA2_MEMSET%” /progargs “%IS_DIR%\bin\ini.cnf”#"-service %2"#%PREPENDCLASSES_SWITCH%#%PREPENDCLASSES%#%APPENDCLASSES_SWITCH%#%APPENDCLASSES%#%ENV_CLASSPATH_SWITCH%#%ENV_CLASSPATH%#%3#%4#%5#%6#%7#%8#%9
goto :EOF
)

and

if exist LOCKFILE del LOCKFILE

if “%EL%”==“42” goto start

codes, if do rem of 1 st snippet, it will execute rest of the code, if do rem of 1 st snippest, it will be problem

regards,
anil kumar

Anil,

I wouldn’t suggest messing around in the batch file so much. If there is no particular reason why you need to go commenting those lines I suggest you to just add the line of code mentioned earlier just after this line and leave the rest intact: cd /d “%IS_DIR%”

This will take care deleting the LOCKFILE if it exists just before starting an instance of the IS.

Leaving the IF statement intact that you are trying to comment will make sure that only one IS instance runs at a time. If by chance you execute the batch file while already an instance is running the DEL LOCKFILE command will fail but this IF block will detect file presence and exit the batch execution.


Try it and let us know how it goes.

-HTH

if i add

if exist …\LOCKFILE del …\LOCKFILE step above the

if exist LOCKFILE (
echo Only one Integration Server instance may be run from a particular
echo installation at a time. Make sure that this server is shutdown
echo before trying to start it. If no server is running, then
echo delete the file
echo %IS_DIR%\LOCKFILE
echo and try to start the server again.
goto :EOF
)

what will happen if one instace is running, if i start another instance it will delete the lockfile and start the another instance right

Regards,
Anil kumar ellendula

No it wouldn’t. The delete command will fail as the LOCKFILE will be in use by the running IS instance. The if statement will check and exit the batch file execution.

Hi Suren,

I added if exist …\LOCKFILE del …\LOCKFILE step above the

if exist LOCKFILE (
echo Only one Integration Server instance may be run from a particular
echo installation at a time. Make sure that this server is shutdown
echo before trying to start it. If no server is running, then
echo delete the file
echo %IS_DIR%\LOCKFILE
echo and try to start the server again.
goto :EOF
)

i have restarted the windows OS ,LOCKfile exist in the <wM_installation>/Integration server folder and IS is not started becz Lock file is not deleted.

Same problem i am facing here.

Regards,
Anil kumar ellendula

Anil,
Remove the two dots… from the commands like so:

if exist LOCKFILE del LOCKFILE 

This isn’t working for us too…I have updated per your suggestion on this thread…

:start
rem … server must start in install directory
cd /d “%IS_DIR%”

if exist LOCKFILE del LOCKFILE

if exist LOCKFILE (
echo Only one Integration Server instance may be run from a particular
echo installation at a time. Make sure that this server is shut down
echo before trying to start it. If no server is running, then
echo delete the file
echo %IS_DIR%\LOCKFILE.
echo and try to start the server again.
goto :EOF
)
echo. > LOCKFILE

Any imore nputs?

TIA,
RMG

please help me how to delete the lockfile, any updates on this thread