
hydpm
User
Jul 24, 2008, 8:27 AM
Post #1 of 3
(1688 views)
|
|
When i call a .bat file in a System() function , it is not releasing control after that bat executed
|
Can't Post
|
|
hi, Here is one interesting problem i had. I executed a batch file which starts the my server. When the below code ran, it is able to start the server. But in the console when i try to stop that and performing some other thing it is not terminating. When i press Ctrl+C and it is giving a message Terminate the Signal , when i say Yes still it is repeatedly asking the same. then i am closing the console window to get rid of that: --------------------------------------------------------------------------------- [VV] DEBUG [main] SeleniumClient.<init>(112) | Proxy host=localhost [VV] DEBUG [main] SeleniumClient.<init>(113) | Proxy port=4444 [VV] DEBUG [main] SeleniumClient.<init>(114) | Browser spec=*chrome [VV] DEBUG [main] SeleniumClient.<init>(115) | App URL=http://10.0.14.199:9090 [VV] DEBUG [main] SeleniumClient.<init>(116) | App context=VoiceConsole [VV] DEBUG [main] DbUnitStepRunner.startTesting(177) | DbUnit dataset dir: C:\Ra dium\VoiceConsole\test_data\data\dbunit Jul 24, 2008 11:22:09 AM org.apache.cxf.service.factory.ReflectionServiceFactory Bean buildServiceFromClass INFO: Creating Service {http://server.radium.vocollect.com}RadiumWebService from class com.vocollect.radium.server.RadiumWebService Jul 24, 2008 11:22:09 AM org.apache.cxf.service.factory.ReflectionServiceFactory Bean buildServiceFromClass INFO: {http://server.radium.vocollect.com}steps part element name {http://server .radium.vocollect.com}steps references element {http://server.radium.vocollect.c om}steps {http://server.radium.vocollect.com}return part element name {http://server.radi um.vocollect.com}return references element {http://server.radium.vocollect.com}r eturn Jul 24, 2008 11:22:09 AM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be http://localhost:8282/Radium 2008-07-24 11:22:09.860::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2008-07-24 11:22:09.875::INFO: jetty-6.1.x 2008-07-24 11:22:09.953::INFO: Started SelectChannelConnector@0.0.0.0:8282 Terminating on signal SIGINT(2) C:\MTA\main\PerlModules\Vocollect-VoiceConsole-Util\lib\Vocollect\VoiceConsole\U til>Terminate batch job (Y/N)? Y 'Y' is not recognized as an internal or external command, operable program or batch file. C:\MTA\main\PerlModules\Vocollect-VoiceConsole-Util\lib\Vocollect\VoiceConsole\U til>cls Terminate batch job (Y/N)? C:\MTA\main\PerlModules\Vocollect-VoiceConsole-Util\lib\Vocollect\VoiceConsole\U til> Terminate batch job (Y/N)? y 'y' is not recognized as an internal or external command, operable program or batch file. C:\MTA\main\PerlModules\Vocollect-VoiceConsole-Util\lib\Vocollect\VoiceConsole\U til> Terminate batch job (Y/N)? Y 'Y' is not recognized as an internal or external command, operable program or batch file. C:\MTA\main\PerlModules\Vocollect-VoiceConsole-Util\lib\Vocollect\VoiceConsole\U til>cls Terminate batch job (Y/N)? C:\MTA\main\PerlModules\Vocollect-VoiceConsole-Util\lib\Vocollect\VoiceConsole\U til> ---------------------------------------------------------------------------------------- Code: The code causing above effect. I think there is some thing issue with the way System() function works when we ran Batch file in it. print "$hostname is NOT listening on tcp port $portnumber.\n"; print "START The Radium and Selenium Servers\n"; my $driveletter = $ENV{"SYSTEMDRIVE"}; chomp($driveletter); my $radpath = "$driveletter\\Radium\\bin\\radium-ws.bat"; chdir("$driveletter\\Radium\\bin\\"); system("radium-ws.bat"); ----------------------- I appreciate if some one helps why it is behaving like that and solution to get rid of that. -raj
|