Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I do have a bat(startJboss.bat) file that starts a JBoss server. When I start it it creates an output to standard cmd (windows) console. When I want to politely end this process I just hit Ctrl + C and the shutdown of the server is as expected.

I want to start the server from cygwin console. So starting is ok, just

cmd /c startJboss.bat

and the server is up. I want to be able to politely stop it from cygwin as well. When hitting the Ctrl + C in cygwin it shuts the wrapping cmd directly but the kill signal is not propagated to the underlying process. So the server is not properly shut down.

How should I propagate the Ctrl + C signal to the process that is started in the bat file?

share|improve this question
    
is it an option to use the kill command to send a signal to the process? –  golimar Jun 11 '13 at 9:30
    
The kill is sent only to the "cmd" command. I need to propagate it to the startJboss.bat (it starts the server java process) –  wertikal Jun 18 '13 at 8:38
    
you can kill any process with the kill or killall commands... –  golimar Jun 18 '13 at 8:44
    
pstree should show all the process's children, from that you could write a script to kill them. –  Philip Kearns Jun 18 '13 at 14:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.