I’m a bit new to Ruby, and I’m trying to set up a tomcat control script.
The main loop of the control script will allow the user to start, stop,
and configure various instances of Tomcat.
In this scenario, if a user wishes to start a tomcat instance, he/she
% start 8080
The script then will execute:
command = “8080/bin/catalina.sh start”
And then the catalina.sh script will then execute some java [options…]
& in the background.
The control is then returned to the main program loop. This works well.
However, any CTRL-C that the main Ruby control loop receives is always
propagated to the java process that is in the background, shutting down
all of the servers that I have started using this script. I can’t seem
to control this propagation. I’ve added:
puts “Interrupt caught…”
Which works, but the interrupt still makes its way out to my child
processes. Is there any way that I can have these programs continue to
execute in the background?
Thanks for any help.