I am trying to run my jboss as services with predefined processor affinities. After trying imagecfg.exe (which somehow not works for java.exe file) and others, I have decided to modify run.bat script, which basically runs org.jboss.Main classe, I did it as follows:
start /affinity 3 %JAVA% "%JAVA_OPTS%" ^
-classpath "%JBOSS_CLASSPATH%" ^
It works perfectly with one BUT. I start this as Windows Service. When I click "START" it gives me error that service started and stopped, but I see in task manager that it actually works! Just the service state is incorrect (stopped). I think it is because during service start, it takes output/result of "start" program, not "java.exe" which is being launched by "start" command.
Is there any way to tell service manager it's running? I mean, like return some result code or redirect java.exe output? To clarify, if I remove
start /affinity 3
then I have original fully working script, but then jboss uses all CPU instances, what I'd like to avoid.