From: Tim Starling Date: Sat, 3 Jan 2009 00:31:01 +0000 (+0000) Subject: * Fix some command-line propagation issues X-Git-Tag: 1.31.0-rc.0~43594 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=7deb05f35a9b5d01c4110e1e1a10c4285b806998;p=lhc%2Fweb%2Fwiklou.git * Fix some command-line propagation issues * Fix weird failure to open /dev/stdout * Wait for slaves after each child command --- diff --git a/maintenance/storage/recompressTracked.php b/maintenance/storage/recompressTracked.php index ea34a16870..7e4ed1b4f4 100644 --- a/maintenance/storage/recompressTracked.php +++ b/maintenance/storage/recompressTracked.php @@ -169,7 +169,9 @@ class RecompressTracked { function startSlaveProcs() { $cmd = 'php ' . wfEscapeShellArg( __FILE__ ); foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) { - if ( in_array( $cmdOption, self::$optionsWithArgs ) ) { + if ( $cmdOption == 'slave-id' ) { + continue; + } elseif ( in_array( $cmdOption, self::$optionsWithArgs ) && isset( $this->$classOption ) ) { $cmd .= " --$cmdOption " . wfEscapeShellArg( $this->$classOption ); } elseif ( $this->$classOption ) { $cmd .= " --$cmdOption"; @@ -184,14 +186,14 @@ class RecompressTracked { $pipes = false; $spec = array( array( 'pipe', 'r' ), - array( 'file', '/dev/stdout', 'w' ), - array( 'file', '/dev/stderr', 'w' ) + array( 'file', 'php://stdout', 'w' ), + array( 'file', 'php://stderr', 'w' ) ); wfSuppressWarnings(); $proc = proc_open( "$cmd --slave-id $i", $spec, $pipes ); wfRestoreWarnings(); if ( !$proc ) { - $this->critical( "Error opening slave process" ); + $this->critical( "Error opening slave process: $cmd" ); exit( 1 ); } $this->slaveProcs[$i] = $proc; @@ -396,6 +398,7 @@ class RecompressTracked { case 'quit': return; } + wfWaitForSlaves( 5 ); } }