i am running a headless selenium process along a jenkins server on an AMI linux box, all managed by runit.
the problem is that issuing "sv stop selenium" or "sv reload selenium" do not term or kill the old instance along its child processes, but merely detach them from the runsv process, so they continue to run without runit knowing about them, resulting in a failing restart try of the service.
i think my question is kind of related to this: How to write runit custom stop script
meaning: i should probably try a custom d control script, in order to manually clean up.
I followed this idea: https://stackoverflow.com/questions/392022/best-way-to-kill-all-child-processes
However, cat'ing the pid from /etc/sv/selenium/supervise/pid and forwarding it to the loop didn't do any difference.
sv run script:
#!/bin/sh exec 2>&1 exec chpst -u jenkins -U jenkins /usr/bin/xvfb-run \ --server-args="-screen 0 1024x768x32" \ /usr/bin/java -jar /usr/local/bin/selenium-server-standalone-2.42.1.jar \ -ensureCleanSession \ -browserSessionReuse