Changeset 32323 for gs2-extensions/open-office
- Timestamp:
- 2018-08-06T19:38:44+12:00 (6 years ago)
- Location:
- gs2-extensions/open-office/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/open-office/trunk/src/perllib/plugins/OpenOfficeConverter.pm
r32317 r32323 73 73 74 74 #my $cmd = "soffice --headless 2>&1"; # for linux and mac 75 my $cmd = "soffice \"--accept=socket,host=$ENV{'SOFFICE_HOST'},port=$ENV{'SOFFICE_PORT'};urp;StarOffice.ServiceManager\" --headless 2>&1"; # for linux and mac75 my $cmd = "soffice \"--accept=socket,host=$ENV{'SOFFICE_HOST'},port=$ENV{'SOFFICE_PORT'};urp;StarOffice.ServiceManager\" --headless"; # basic shared command 76 76 my $status = 0; 77 77 … … 100 100 $status = system("which soffice >nul 2>&1"); # which.exe should be in bin/windows 101 101 if ($status == 0) { 102 $cmd = "start \"soffice process\" soffice \"--accept=socket,host=$ENV{'SOFFICE_HOST'},port=$ENV{'SOFFICE_PORT'};urp;StarOffice.ServiceManager\" --headless 2>&1"; 103 $cmd .= " >nul"; 102 $cmd = "start \"soffice process\" $cmd >nul 2>&1"; # order of >nul and 2>&1 matters, see below 104 103 #print STDERR "***** Tried to start-up OpenOffice with:\n$cmd\n"; 105 104 } … … 110 109 # automatically puts it in the background). 111 110 # For Unix putting it in the background needs to be done 112 # explicitly 113 114 $cmd .= " >/dev/null &"; 115 } 111 # explicitly by appending & to the end 112 113 # IMPORTANT! When redirecting output from 2>&1 to a file or null, >/dev/null (or >out.txt) should come BEFORE 2>&1 114 # i.e. $some_cmd >out.txt 2>&1 and likewise $some_cmd >/dev/null 2>&1 115 # Doing it in the wrong order further causes problems with SafeProcess when GLI starts up and calls pluginfo on the pluginslist: 116 # SafeProcess blocks forever on read() from stdout of the process running pluginfo, because there's never data including no eof/eos 117 # on the process' stdout when running this command in the wrong order. 118 $cmd .= " >/dev/null 2>&1 &"; 119 } 120 121 #print STDERR "@@@@ running: $cmd\n"; 116 122 117 123 $status = system($cmd) if ($status == 0);
Note:
See TracChangeset
for help on using the changeset viewer.