I'm running Solr with the default Jetty setup on Windows. If I start
solr with "java -jar start.jar" from a command window, then I can
cleanly shut down Solr/Jetty by hitting Control-C. In particular, this
causes the shutdown hook to execute, which appears to be important.

However, I don't especially want to run Solr from a command window.
Instead, I want to launch it from a scheduled task, which
does the "java -jar start.jar" in a non-interactive way and which
does not bring up a command window. If I were on unix I could
use the kill command to send an appropriate signal to the JVM, but
I gather this doesn't work on Windows.

As such, what is the proper way to cleanly shut down Solr/Jetty on Windows,
if they are not running in a command window? The main way I know how to kill
Solr right now if it's running outside a command window is to go to the
Windows task manager and kill the java.exe process there. But this seems
to kill java immediately, so I'm doubtful that the shutdown hook is
getting executed.

I found a couple of threads through Google suggesting that Jetty now has a
stop.jar
script that's capable of stopping Jetty in a clean way across platforms.
Is this maybe the best option? If so, would it be possible to include
stop.jar in the Solr example/ directory?

Reply via email to