Created
November 4, 2009 18:57
-
-
Save tarcieri/226290 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_solr | |
defs = { | |
'jetty.home' => @path, | |
'solr.data.dir' => @path/'solr'/'data' | |
}.map { |k, v| "-D#{k}=#{v}" }.join(' ') | |
cmd = "java -jar #{@path}/start.jar #{@path/'etc'/'jetty.xml'} -classpath #{@path/'lib'} #{defs}" | |
# IO.popen is more portable than fork/exec (i.e. to JRuby) | |
pid = IO.popen(cmd, 'r').pid | |
puts "PID: #{pid}" | |
pid | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment