[24453] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
| 3 | # solrserver.pm -- class for starting and stopping the Solr/jetty server
|
---|
| 4 | # A component of the Greenstone digital library software
|
---|
| 5 | # from the New Zealand Digital Library Project at the
|
---|
| 6 | # University of Waikato, New Zealand.
|
---|
| 7 | #
|
---|
| 8 | # Copyright (C) 1999 New Zealand Digital Library Project
|
---|
| 9 | #
|
---|
| 10 | # This program is free software; you can redistribute it and/or modify
|
---|
| 11 | # it under the terms of the GNU General Public License as published by
|
---|
| 12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 13 | # (at your option) any later version.
|
---|
| 14 | #
|
---|
| 15 | # This program is distributed in the hope that it will be useful,
|
---|
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 18 | # GNU General Public License for more details.
|
---|
| 19 | #
|
---|
| 20 | # You should have received a copy of the GNU General Public License
|
---|
| 21 | # along with this program; if not, write to the Free Software
|
---|
| 22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 23 | #
|
---|
| 24 | ###########################################################################
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | package solrserver;
|
---|
| 28 |
|
---|
| 29 | use strict;
|
---|
[24483] | 30 | #no strict 'refs';
|
---|
[24453] | 31 |
|
---|
| 32 | use solrutil;
|
---|
| 33 |
|
---|
| 34 | sub new {
|
---|
| 35 | my $class = shift(@_);
|
---|
[24501] | 36 | my ($build_dir) = @_;
|
---|
[24453] | 37 |
|
---|
[24484] | 38 | my $self = { 'jetty_stop_key' => "greenstone-solr" };
|
---|
[24453] | 39 |
|
---|
[24501] | 40 | $self->{'build_dir'} = $build_dir;
|
---|
| 41 |
|
---|
[24453] | 42 | my $search_path = &solrutil::get_search_path();
|
---|
| 43 |
|
---|
| 44 | my $server_jar = &util::filename_cat("lib","java","solr-jetty-server.jar");
|
---|
| 45 | my $full_server_jar = solrutil::locate_file($search_path,$server_jar);
|
---|
| 46 | $self->{'full_server_jar'} = $full_server_jar;
|
---|
| 47 |
|
---|
| 48 | $self->{'jetty_explicitly_started'} = undef;
|
---|
| 49 |
|
---|
[24483] | 50 | my $jetty_server_port = $ENV{'SOLR_JETTY_PORT'};
|
---|
| 51 | my $base_url = "http://localhost:$jetty_server_port/solr/";
|
---|
| 52 | my $admin_url = "http://localhost:$jetty_server_port/solr/admin/cores";
|
---|
| 53 |
|
---|
| 54 | $self->{'base-url'} = $base_url;
|
---|
| 55 | $self->{'admin-url'} = $admin_url;
|
---|
| 56 |
|
---|
[24453] | 57 | return bless $self, $class;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
[25899] | 60 | sub set_jetty_stop_key {
|
---|
| 61 | my $self = shift (@_);
|
---|
| 62 | my ($stop_key) = @_;
|
---|
[24483] | 63 |
|
---|
[25899] | 64 | $self->{'jetty_stop_key'} = $stop_key if defined $stop_key;
|
---|
| 65 | }
|
---|
[24483] | 66 |
|
---|
| 67 | sub _wget_service
|
---|
| 68 | {
|
---|
| 69 | my $self = shift (@_);
|
---|
| 70 | my ($output_format,$url,$cgi_get_args) = @_;
|
---|
| 71 |
|
---|
| 72 | my $full_url = $url;
|
---|
| 73 |
|
---|
| 74 | $url .= "?$cgi_get_args" if (defined $cgi_get_args);
|
---|
| 75 |
|
---|
| 76 | my $cmd = "wget -O - \"$url\" 2>&1";
|
---|
| 77 |
|
---|
| 78 | my $preamble_output = "";
|
---|
| 79 | my $xml_output = "";
|
---|
| 80 | my $error_output = undef;
|
---|
| 81 |
|
---|
| 82 | my $in_preamble = ($output_format eq "xml") ? 1 : 0;
|
---|
| 83 |
|
---|
[24501] | 84 | ## print STDERR "**** wgetcmd = \n $cmd\n";
|
---|
| 85 |
|
---|
[24483] | 86 | if (open(WIN,"$cmd |")) {
|
---|
| 87 |
|
---|
| 88 | my $line;
|
---|
| 89 | while (defined ($line=<WIN>)) {
|
---|
| 90 |
|
---|
| 91 | if ($line =~ m/ERROR \d+:/) {
|
---|
| 92 | chomp $line;
|
---|
| 93 | $error_output = $line;
|
---|
| 94 | last;
|
---|
| 95 | }
|
---|
| 96 | elsif ($line =~ m/failed: Connection refused/) {
|
---|
| 97 | chomp $line;
|
---|
| 98 | $error_output = $line;
|
---|
| 99 | last;
|
---|
| 100 | }
|
---|
| 101 | elsif ($in_preamble) {
|
---|
| 102 | if ($line =~ m/<.*>/) {
|
---|
| 103 | $in_preamble = 0;
|
---|
| 104 | }
|
---|
| 105 | else {
|
---|
| 106 | $preamble_output .= $line;
|
---|
| 107 | }
|
---|
| 108 | }
|
---|
| 109 |
|
---|
| 110 | if (! $in_preamble) {
|
---|
| 111 | $xml_output .= $line;
|
---|
| 112 | }
|
---|
| 113 | }
|
---|
| 114 | close(WIN);
|
---|
| 115 |
|
---|
| 116 | }
|
---|
| 117 | else {
|
---|
| 118 | $error_output = "Error: failed to run $cmd\n";
|
---|
| 119 | $error_output .= " $!\n";
|
---|
| 120 | }
|
---|
| 121 |
|
---|
[24643] | 122 | my $output = { 'url' => $full_url,
|
---|
| 123 | 'preamble' => $preamble_output,
|
---|
[24483] | 124 | 'output' => $xml_output,
|
---|
| 125 | 'error' => $error_output };
|
---|
| 126 |
|
---|
| 127 | return $output;
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 |
|
---|
| 131 | sub _base_service
|
---|
| 132 | {
|
---|
| 133 | my $self = shift (@_);
|
---|
| 134 | my ($cgi_get_args) = @_;
|
---|
| 135 |
|
---|
| 136 | my $base_url = $self->{'base-url'};
|
---|
| 137 |
|
---|
| 138 | return $self->_wget_service("html",$base_url,$cgi_get_args);
|
---|
| 139 | }
|
---|
| 140 |
|
---|
| 141 | sub _admin_service
|
---|
| 142 | {
|
---|
| 143 | my $self = shift (@_);
|
---|
| 144 | my ($cgi_get_args) = @_;
|
---|
| 145 |
|
---|
| 146 | my $admin_url = $self->{'admin-url'};
|
---|
| 147 |
|
---|
| 148 | return $self->_wget_service("xml",$admin_url,$cgi_get_args);
|
---|
| 149 | }
|
---|
| 150 |
|
---|
| 151 |
|
---|
| 152 | sub server_running
|
---|
| 153 | {
|
---|
| 154 | my $self = shift @_;
|
---|
| 155 |
|
---|
| 156 | my $output = $self->_base_service();
|
---|
| 157 |
|
---|
| 158 | my $have_error = defined $output->{'error'};
|
---|
| 159 |
|
---|
| 160 | my $running = !$have_error;
|
---|
| 161 |
|
---|
| 162 | return $running;
|
---|
| 163 | }
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | sub admin_ping_core
|
---|
| 167 | {
|
---|
| 168 | my $self = shift @_;
|
---|
| 169 | my ($core) = @_;
|
---|
| 170 |
|
---|
| 171 | my $cgi_get_args = "action=STATUS&core=$core";
|
---|
| 172 |
|
---|
| 173 | my $ping_status = 1;
|
---|
| 174 |
|
---|
| 175 | my $output = $self->_admin_service($cgi_get_args);
|
---|
| 176 |
|
---|
| 177 | if (defined $output->{'error'}) {
|
---|
| 178 | # severe error, such as failing to connect to the server
|
---|
| 179 | $ping_status = 0;
|
---|
| 180 |
|
---|
| 181 | my $url = $output->{'url'};
|
---|
| 182 | my $preamble = $output->{'preamble'};
|
---|
| 183 | my $error = $output->{'error'};
|
---|
| 184 |
|
---|
| 185 | print STDERR "----\n";
|
---|
| 186 | print STDERR "Error: Failed to get XML response from:\n";
|
---|
| 187 | print STDERR " $url\n";
|
---|
| 188 | print STDERR "Output was:\n";
|
---|
| 189 | print STDERR $preamble if ($preamble ne "");
|
---|
| 190 | print STDERR "$error\n";
|
---|
| 191 | print STDERR "----\n";
|
---|
| 192 | }
|
---|
| 193 | else {
|
---|
| 194 |
|
---|
| 195 | # If the collection doesn't exist yet, then there will be
|
---|
| 196 | # an empty element of the form:
|
---|
| 197 | # <lst name="collect-doc"/>
|
---|
| 198 | # where 'collect' is the actual name of the collection,
|
---|
| 199 | # such as demo
|
---|
| 200 |
|
---|
| 201 | my $xml_output = $output->{'output'};
|
---|
| 202 |
|
---|
| 203 | my $empty_element="<lst\\s+name=\"$core\"\\s*\\/>";
|
---|
| 204 |
|
---|
| 205 | $ping_status = !($xml_output =~ m/$empty_element/s);
|
---|
| 206 | }
|
---|
| 207 |
|
---|
| 208 | return $ping_status;
|
---|
| 209 | }
|
---|
| 210 |
|
---|
[25888] | 211 | # Some of the Solr CoreAdmin API calls available.
|
---|
| 212 | # See http://wiki.apache.org/solr/CoreAdmin
|
---|
[24483] | 213 | sub admin_reload_core
|
---|
| 214 | {
|
---|
| 215 | my $self = shift @_;
|
---|
| 216 | my ($core) = @_;
|
---|
| 217 |
|
---|
| 218 | my $cgi_get_args = "action=RELOAD&core=$core";
|
---|
| 219 |
|
---|
| 220 | $self->_admin_service($cgi_get_args);
|
---|
| 221 | }
|
---|
| 222 |
|
---|
[25888] | 223 | sub admin_rename_core
|
---|
| 224 | {
|
---|
| 225 | my $self = shift @_;
|
---|
| 226 | my ($oldcore, $newcore) = @_;
|
---|
[24483] | 227 |
|
---|
[25888] | 228 | my $cgi_get_args = "action=RENAME&core=$oldcore&other=$newcore";
|
---|
| 229 |
|
---|
| 230 | $self->_admin_service($cgi_get_args);
|
---|
| 231 | }
|
---|
| 232 |
|
---|
| 233 | sub admin_swap_core
|
---|
| 234 | {
|
---|
| 235 | my $self = shift @_;
|
---|
| 236 | my ($oldcore, $newcore) = @_;
|
---|
| 237 |
|
---|
| 238 | my $cgi_get_args = "action=SWAP&core=$oldcore&other=$newcore";
|
---|
| 239 |
|
---|
| 240 | $self->_admin_service($cgi_get_args);
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 | # The ALIAS action is not supported in our version of solr (despite it
|
---|
| 244 | # being marked as experimental in the documentation for Core Admin)
|
---|
| 245 | sub admin_alias_core
|
---|
| 246 | {
|
---|
| 247 | my $self = shift @_;
|
---|
| 248 | my ($oldcore, $newcore) = @_;
|
---|
| 249 |
|
---|
| 250 | my $cgi_get_args = "action=ALIAS&core=$oldcore&other=$newcore";
|
---|
| 251 |
|
---|
| 252 | $self->_admin_service($cgi_get_args);
|
---|
| 253 | }
|
---|
| 254 |
|
---|
[24483] | 255 | sub admin_create_core
|
---|
| 256 | {
|
---|
| 257 | my $self = shift @_;
|
---|
[25888] | 258 | my ($core, $data_parent_dir) = @_; # data_parent_dir is optional, can be index_dir. Defaults to builddir if not provided
|
---|
[24483] | 259 |
|
---|
[24501] | 260 | my ($ds_idx) = ($core =~ m/^.*-(.*?)$/);
|
---|
[24483] | 261 |
|
---|
| 262 | my $cgi_get_args = "action=CREATE&name=$core";
|
---|
| 263 |
|
---|
| 264 | my $collect_home = $ENV{'GSDLCOLLECTDIR'};
|
---|
| 265 | my $etc_dirname = &util::filename_cat($collect_home,"etc");
|
---|
[25888] | 266 |
|
---|
| 267 | if(!defined $data_parent_dir) {
|
---|
| 268 | $data_parent_dir = $self->{'build_dir'};
|
---|
| 269 | }
|
---|
| 270 |
|
---|
| 271 | my $idx_dirname = &util::filename_cat($data_parent_dir,$ds_idx); # "dataDir"
|
---|
[24483] | 272 |
|
---|
| 273 | $cgi_get_args .= "&instanceDir=$etc_dirname";
|
---|
| 274 | $cgi_get_args .= "&dataDir=$idx_dirname";
|
---|
| 275 |
|
---|
| 276 | $self->_admin_service($cgi_get_args);
|
---|
| 277 | }
|
---|
| 278 |
|
---|
[25899] | 279 | # removes (unloads) core from the ext/solr/sorl.xml config file
|
---|
[25888] | 280 | sub admin_unload_core
|
---|
| 281 | {
|
---|
| 282 | my $self = shift @_;
|
---|
[25889] | 283 | my ($core, $delete) = @_;
|
---|
[24483] | 284 |
|
---|
[25888] | 285 | my $cgi_get_args = "action=UNLOAD&core=$core"; # &deleteIndex=true from Solr3.3
|
---|
[25889] | 286 | if(defined $delete && $delete == 1) {
|
---|
| 287 | $cgi_get_args = $cgi_get_args."&deleteIndex=true";
|
---|
| 288 | }
|
---|
[24483] | 289 |
|
---|
[25888] | 290 | $self->_admin_service($cgi_get_args);
|
---|
| 291 | }
|
---|
| 292 |
|
---|
| 293 | sub copy_solrxml_to_web
|
---|
| 294 | {
|
---|
| 295 | my $self = shift @_;
|
---|
| 296 |
|
---|
| 297 | my $ext_solrxml = &util::filename_cat($ENV{'GEXT_SOLR'}, "solr.xml");
|
---|
| 298 | my $web_solrxml = &util::filename_cat($ENV{'GSDL3HOME'}, "ext", "solr", "solr.xml");
|
---|
| 299 |
|
---|
| 300 | #print STDERR "@@@@ Copying $ext_solrxml to $web_solrxml...\n";
|
---|
| 301 |
|
---|
[27847] | 302 | &FileUtils::copyFiles($ext_solrxml, $web_solrxml);
|
---|
[25888] | 303 | }
|
---|
| 304 |
|
---|
[24453] | 305 | sub start
|
---|
| 306 | {
|
---|
| 307 | my $self = shift @_;
|
---|
[25899] | 308 | my ($verbosity) = @_;
|
---|
| 309 |
|
---|
| 310 | $verbosity = 1 unless defined $verbosity;
|
---|
[24453] | 311 |
|
---|
| 312 | my $solr_home = $ENV{'GEXT_SOLR'};
|
---|
| 313 | my $jetty_stop_port = $ENV{'JETTY_STOP_PORT'};
|
---|
| 314 | my $jetty_server_port = $ENV{'SOLR_JETTY_PORT'};
|
---|
| 315 |
|
---|
| 316 | chdir($solr_home);
|
---|
| 317 |
|
---|
[24501] | 318 | ## my $solr_etc = &util::filename_cat($solr_home,"etc");
|
---|
[24453] | 319 |
|
---|
| 320 | my $server_props = "-DSTOP.PORT=$jetty_stop_port";
|
---|
| 321 | $server_props .= " -DSTOP.KEY=".$self->{'jetty_stop_key'};
|
---|
[24501] | 322 | $server_props .= " -Dsolr.solr.home=$solr_home";
|
---|
[24453] | 323 |
|
---|
| 324 | my $full_server_jar = $self->{'full_server_jar'};
|
---|
| 325 |
|
---|
| 326 | my $server_java_cmd = "java $server_props -jar \"$full_server_jar\"";
|
---|
| 327 |
|
---|
| 328 |
|
---|
[24483] | 329 | my $server_status = "unknown";
|
---|
[24453] | 330 |
|
---|
[24486] | 331 | if ($self->server_running()) {
|
---|
[24483] | 332 | $server_status = "already-running";
|
---|
[24453] | 333 | }
|
---|
[24483] | 334 | elsif (open(STARTIN,"$server_java_cmd 2>&1 |")) {
|
---|
[24453] | 335 |
|
---|
[25899] | 336 | print STDERR "**** starting up solr jetty server with cmd start =\n $server_java_cmd\n" if ($verbosity > 1);
|
---|
[24501] | 337 |
|
---|
[24483] | 338 | my $line;
|
---|
| 339 | while (defined($line=<STARTIN>)) {
|
---|
| 340 | # Scan through output until you see a line like:
|
---|
| 341 | # 2011-08-22 .. :INFO::Started [email protected]:8983
|
---|
| 342 | # which signifies that the server has started up and is
|
---|
| 343 | # "ready and listening"
|
---|
[24453] | 344 |
|
---|
[24483] | 345 | if (($line =~ m/^(WARN|ERROR|SEVERE):/)
|
---|
| 346 | || ($line =~ m/^[0-9 :-]*(WARN|ERROR|SEVERE)::/)) {
|
---|
| 347 | print "Jetty startup: $line";
|
---|
[24453] | 348 | }
|
---|
[24483] | 349 |
|
---|
| 350 | if ($line =~ m/WARN::failed SocketConnector/) {
|
---|
| 351 | if ($line =~ m/Address already in use/) {
|
---|
| 352 | $server_status = "already-running";
|
---|
| 353 | }
|
---|
| 354 | else {
|
---|
| 355 | $server_status = "failed-to-start";
|
---|
| 356 | }
|
---|
| 357 | last;
|
---|
[24453] | 358 | }
|
---|
[24483] | 359 |
|
---|
| 360 | if ($line =~ m/INFO::Started SocketConnector/) {
|
---|
| 361 | $server_status = "explicitly-started";
|
---|
| 362 | last;
|
---|
| 363 | }
|
---|
[24453] | 364 | }
|
---|
| 365 | }
|
---|
[24483] | 366 | else {
|
---|
| 367 | print STDERR "Error: failed to start solr-jetty-server\n";
|
---|
| 368 | print STDERR "$!\n";
|
---|
| 369 | print STDERR "Command attempted was:\n";
|
---|
| 370 | print STDERR " $server_java_cmd\n";
|
---|
| 371 | print STDERR "run from directory:\n";
|
---|
| 372 | print STDERR " $solr_home\n";
|
---|
| 373 | print STDERR "----\n";
|
---|
| 374 |
|
---|
| 375 | exit -1;
|
---|
| 376 | }
|
---|
| 377 |
|
---|
[24453] | 378 | if ($server_status eq "explicitly-started") {
|
---|
| 379 | $self->{'jetty_explicitly_started'} = 1;
|
---|
[24483] | 380 | print "Jetty server ready and listening for connections on port";
|
---|
| 381 | print " $jetty_server_port\n";
|
---|
[24453] | 382 |
|
---|
| 383 | # now we know the server is ready to accept connections, fork a
|
---|
| 384 | # child process that continues to listen to the output and
|
---|
| 385 | # prints out any lines that are not INFO lines
|
---|
| 386 |
|
---|
| 387 | if (fork()==0) {
|
---|
| 388 | # child process
|
---|
[24483] | 389 |
|
---|
[24453] | 390 | my $line;
|
---|
| 391 | while (defined ($line = <STARTIN>)) {
|
---|
| 392 |
|
---|
| 393 | # if (($line =~ m/^(WARN|ERROR|SEVERE):/)
|
---|
| 394 | # || ($line =~ m/^[0-9 :-]*(WARN|ERROR|SEVERE)::/)) {
|
---|
| 395 | # print "Jetty $line";
|
---|
| 396 | # }
|
---|
| 397 |
|
---|
| 398 | # skip info lines
|
---|
| 399 | next if ($line =~ m/^INFO:/);
|
---|
| 400 | next if ($line =~ m/^[0-9 :-]*INFO::/);
|
---|
| 401 | next if ($line =~ m/^\d{2}\/\d{2}\/\d{4}\s+/);
|
---|
| 402 | next if ($line =~ m/^\d{4}-\d{2}-\d{2}\s+/);
|
---|
| 403 |
|
---|
| 404 | ## next if ($line =~ m/^\s*\w+{.*}/);
|
---|
| 405 |
|
---|
| 406 | # if here, then some non-trival message has been logged
|
---|
| 407 | print "Jetty/Solr processing: $line";
|
---|
| 408 | }
|
---|
| 409 | close(STARTIN);
|
---|
| 410 |
|
---|
| 411 | # And now stop nicely
|
---|
| 412 | exit 0;
|
---|
| 413 | }
|
---|
| 414 | # otherwise let the parent continue on
|
---|
| 415 | }
|
---|
| 416 | elsif ($server_status eq "already-running") {
|
---|
[24483] | 417 | print STDERR "Using existing server detected on port $jetty_server_port\n";
|
---|
[24453] | 418 | $self->{'jetty_explicitly_started'} = 0;
|
---|
| 419 | }
|
---|
[24483] | 420 | elsif ($server_status eq "failed-to-start") {
|
---|
| 421 | print STDERR "Started Solr/Jetty web server on port $jetty_server_port";
|
---|
| 422 | print STDERR ", but encountered an initialization error\n";
|
---|
[24453] | 423 | exit -1;
|
---|
| 424 | }
|
---|
| 425 |
|
---|
| 426 | }
|
---|
| 427 |
|
---|
| 428 | sub explicitly_started
|
---|
| 429 | {
|
---|
| 430 | my $self = shift @_;
|
---|
| 431 |
|
---|
| 432 | return $self->{'jetty_explicitly_started'};
|
---|
| 433 | }
|
---|
| 434 |
|
---|
| 435 | sub stop
|
---|
| 436 | {
|
---|
| 437 | my $self = shift @_;
|
---|
| 438 | my ($options) = @_;
|
---|
| 439 |
|
---|
| 440 | my $solr_home = $ENV{'GEXT_SOLR'};
|
---|
| 441 |
|
---|
| 442 | chdir($solr_home);
|
---|
| 443 |
|
---|
| 444 | # defaults
|
---|
| 445 | my $do_wait = 1;
|
---|
| 446 | my $output_verbosity = 1;
|
---|
| 447 |
|
---|
| 448 | if (defined $options) {
|
---|
| 449 | if (defined $options->{'do_wait'}) {
|
---|
| 450 | $do_wait = $options->{'do_wait'};
|
---|
| 451 | }
|
---|
| 452 | if (defined $options->{'output_verbosity'}) {
|
---|
| 453 | $output_verbosity = $options->{'output_verbosity'};
|
---|
| 454 | }
|
---|
| 455 | }
|
---|
| 456 |
|
---|
| 457 | my $full_server_jar = $self->{'full_server_jar'};
|
---|
| 458 | my $jetty_stop_port = $ENV{'JETTY_STOP_PORT'};
|
---|
| 459 |
|
---|
| 460 | my $server_props = "-DSTOP.PORT=$jetty_stop_port";
|
---|
| 461 | $server_props .= " -DSTOP.KEY=".$self->{'jetty_stop_key'};
|
---|
| 462 | my $server_java_cmd = "java $server_props -jar \"$full_server_jar\" --stop";
|
---|
[24483] | 463 |
|
---|
[25899] | 464 | print STDERR "**** java server stop cmd:\n $server_java_cmd\n" if ($output_verbosity>1);
|
---|
[24483] | 465 |
|
---|
[24453] | 466 | if (open(STOPIN,"$server_java_cmd 2>&1 |")) {
|
---|
| 467 |
|
---|
| 468 | my $line;
|
---|
| 469 | while (defined($line=<STOPIN>)) {
|
---|
| 470 | print "Jetty shutdown: $line" if ($output_verbosity>1);
|
---|
| 471 | }
|
---|
| 472 | close(STOPIN);
|
---|
| 473 |
|
---|
| 474 | if ($do_wait) {
|
---|
| 475 | wait(); # let the child process finish
|
---|
| 476 | }
|
---|
| 477 |
|
---|
| 478 | if ($output_verbosity>0) {
|
---|
| 479 | print "Jetty server shutdown\n";
|
---|
| 480 | }
|
---|
| 481 | }
|
---|
| 482 | else {
|
---|
| 483 | print STDERR "Error: failed to stop solr-jetty-server\n";
|
---|
[24483] | 484 | print STDERR "$!\n";
|
---|
[24453] | 485 | print STDERR "Command attempted was:\n";
|
---|
| 486 | print STDERR " $server_java_cmd\n";
|
---|
| 487 | print STDERR "run from directory:\n";
|
---|
| 488 | print STDERR " $solr_home\n";
|
---|
| 489 | print STDERR "----\n";
|
---|
| 490 |
|
---|
| 491 | exit -2;
|
---|
| 492 | }
|
---|
| 493 | }
|
---|
| 494 |
|
---|
| 495 |
|
---|
| 496 |
|
---|
| 497 | 1;
|
---|