I am using the Jetty/Solr build that comes with Solr and would like to run it in the background instead of in the terminal.
Right now I start it by java -jar start.jar
but I would like it to log to a file and run in the background on the server so that I can close the terminal window.
I'm sure there is some java config that I can't find.
I have tried java -jar start.jar > log.txt &
but no luck still outputs to the terminal window.
Thanks.
Solr runs fine with Jetty, as illustrated by the solr/example application. See the instructions in the generic Solr installation page for basic setup info. Solr 1.4. 1 uses Jetty 6.1.
Right click on your Solr/Lucene Java project and select Debug As and then Debug Configurations . Under the Remote Java Application category. Click New to create a new debug configuration. Enter in the port we just specified to Java at the command line – 1044.
Try something like:
nohup yourcommand > output.log 2>&1 &
nohup will prevent yourcommand from being terminated in the event you log out.
& will run it in the background.
> output.log will send stdout to output.log
2>&1 will redirect stderr to stdout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With