-
1. Re: Delay JBoss Services when running in Cluster
peterj Jan 9, 2012 2:23 PM (in response to nmitchell)You do have a separate copy of service.bat for each service, right? And you have modified each of the service.bat files such that they don't conflict (that is, they each use different lock files and redirect stderr/stdout to different log files? If not, check out how I did it for JBoss in Action (http://www.manning.com/jamae), download the source code and look at ch15/src/service/windows/service.bat. And notice how the Ant ch15/build.xml script uses this template to create two separate service.bat files.
However, if the file in question is one used by your apps, and they all need access to the same file, then you could add a delay into the service.bat file to have it wait 15, 30, 45, etc. seconds before launching jbosssvc.exe.
-
2. Re: Delay JBoss Services when running in Cluster
nmitchell Jan 9, 2012 2:49 PM (in response to peterj)That is correct, there are separate service.bat files. I continued digging after my post and came to this same conclusion. I found that the delay can be added within the cmdStart of the service.bat. After uninstalling and reinstalling my services this works to add a delay:
REM create custom delay variable set customDelay=15 :cmdStart REM Executed on service start del %RLOCK% 2>&1 | findstr /C:"being used" > nul if not errorlevel 1 ( echo Could not continue. Locking file already in use. goto cmdEnd ) echo Y > %RLOCK% TIMEOUT /T %customDelay% jbosssvc.exe -p 1 "Starting %SVCDISP%" > %RUNLG% call run.bat %JBOSSSTR% < %RLOCK% >> %RUNLG% 2>&1 jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >> %RUNLG% del %RLOCK% goto cmdEnd
-
3. Re: Delay JBoss Services when running in Cluster
nmitchell Jan 9, 2012 2:52 PM (in response to peterj)Also, FYI, yes my system is setup correctly so that each node is completely independent. Each application has its own logs, and deploy configuration etc.