Changeset 27397 for gs2-extensions/tdb-edit/trunk/src/bin/script
- Timestamp:
- 2013-05-23T13:09:48+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/tdb-edit/trunk/src/bin/script/TDBServer.pl
r26995 r27397 59 59 # We need to do a little file locking 60 60 use Fcntl qw(:flock); #import LOCK_* constants 61 62 61 # Advanced child process control allowing bidirectional pipes 63 62 use IPC::Run qw(harness start pump finish); 64 65 63 # we need to run as a daemon 66 64 use Proc::Daemon; 65 # Try and find the hostname 66 use Sys::Hostname; 67 67 68 68 # The server will need to accept requests from multiple threads, and … … 87 87 my $debug = 1; 88 88 my $server; 89 my $machine_name = `hostname -s`;89 my $machine_name = (`hostname -s` || `hostname -a` || `hostname` || $ENV{'HOSTNAME'}); 90 90 chomp($machine_name); 91 91 my $server_host = $machine_name . '.local'; … … 203 203 { 204 204 print " * Spawning Daemon...\n" unless (!$debug); 205 my $logs_dir = &util::filename_cat($ENV{'GSDLHOME'}, 'collect', $collection, 'logs'); 206 if (!-d $logs_dir) 207 { 208 mkdir($logs_dir, 0755); 209 } 210 my $daemon_out_path = &util::filename_cat($logs_dir, 'tdbserver.out'); 211 my $daemon_err_path = &util::filename_cat($logs_dir, 'tdbserver.err'); 212 $pid = Proc::Daemon::Init( { work_dir => getcwd(), 213 child_STDOUT => $daemon_out_path, 214 child_STDERR => $daemon_err_path, 215 } ); 205 if ($debug) 206 { 207 my $logs_dir = &util::filename_cat($ENV{'GSDLHOME'}, 'collect', $collection, 'logs'); 208 if (!-d $logs_dir) 209 { 210 mkdir($logs_dir, 0755); 211 } 212 my $daemon_out_path = &util::filename_cat($logs_dir, 'tdbserver.out'); 213 my $daemon_err_path = &util::filename_cat($logs_dir, 'tdbserver.err'); 214 $pid = Proc::Daemon::Init( { work_dir => getcwd(), 215 child_STDOUT => $daemon_out_path, 216 child_STDERR => $daemon_err_path, 217 } ); 218 } 219 else 220 { 221 # Streams to /dev/null 222 $pid = Proc::Daemon::Init( { work_dir => getcwd(), 223 } ); 224 } 216 225 } 217 226
Note:
See TracChangeset
for help on using the changeset viewer.