Changeset 26994
- Timestamp:
- 2013-03-05T10:36:41+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/tdb-edit/trunk/src/perllib/dbutil/tdbserver.pm
r26085 r26994 68 68 69 69 my $server_lockfile_path = &util::filename_cat($ENV{'GSDLHOME'},'collect',$collection,'tmp','tdbserver.lock'); 70 #rint " * Searching for lockfile: " . $server_lockfile_path . "\n";70 print " * Searching for TDBServer lockfile...\n"; 71 71 if (!-e $server_lockfile_path) 72 72 { 73 print "Not found.\n"; 73 74 # We need to lock here to ensure only one thread enters the following code, 74 75 # sees a missing TDBServer, and launches it … … 82 83 # ...start it! 83 84 my $launch_cmd = 'TDBServer.pl "' . $$ . '" "' . $collection . '"'; 84 print "* Starting TDBServer for: " . $collection . " [" . $launch_cmd . "] \n";85 print "* Starting TDBServer for: " . $collection . " [" . $launch_cmd . "]... "; 85 86 # @note I once had the below pipe ending with 2>&1 |, but that then blocks 86 87 # indefinitely when looping and reading <SERVERIN>. … … 89 90 my $line = ''; 90 91 my $server_lock_file_created = 0; 92 my $server_host = ''; 93 my $server_port = ''; 91 94 while ($line = <SERVERIN>) 92 95 { 93 96 # - watch for the line indicating a lock file has been created and 94 97 # populated with a sexy port number 95 if ($line =~ /Server now listening /)98 if ($line =~ /Server now listening on ([^:]+):(\d+)/) 96 99 { 100 $server_host = $1; 101 $server_port = $2; 97 102 $server_lock_file_created = 1; 98 103 } … … 114 119 die("Error! TDBServer failed to create lock file. Check server logs."); 115 120 } 121 else 122 { 123 print "Running on " . $server_host . ":" . $server_port . "\n"; 124 } 116 125 # record this for later 117 126 $created_server_lockfile_paths{$server_lockfile_path} = 1; … … 120 129 close($tmp_lockfile_path); 121 130 unlink($tmp_lockfile_path); 131 } 132 else 133 { 134 print "Found!\n"; 122 135 } 123 136 # record this for later
Note:
See TracChangeset
for help on using the changeset viewer.