projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
237986d
)
seperate stderr
author
Alan
<alan@roojs.com>
Thu, 12 Oct 2023 07:30:03 +0000
(15:30 +0800)
committer
Alan
<alan@roojs.com>
Thu, 12 Oct 2023 07:30:03 +0000
(15:30 +0800)
Notify.php
patch
|
blob
|
history
diff --git
a/Notify.php
b/Notify.php
index
d20c726
..
21d8d6d
100644
(file)
--- a/
Notify.php
+++ b/
Notify.php
@@
-401,10
+401,11
@@
class Pman_Core_Notify extends Pman
$tn = $this->tempName('stdout', true);
$tn = $this->tempName('stdout', true);
+ $tne = $this->tempName('stderr', true);
$descriptorspec = array(
0 => array("pipe", 'r'), // stdin is a pipe that the child will read from
1 => array("file", $tn, 'w'), // stdout is a pipe that the child will write to
$descriptorspec = array(
0 => array("pipe", 'r'), // stdin is a pipe that the child will read from
1 => array("file", $tn, 'w'), // stdout is a pipe that the child will write to
- 2 => array("file", $tn, 'w'), // stderr is a file to write to
+ 2 => array("file", $tn
e
, 'w'), // stderr is a file to write to
// 2 => array("pipe", "w") // stderr is a file to write to
);
// 2 => array("pipe", "w") // stderr is a file to write to
);
@@
-454,6
+455,7
@@
class Pman_Core_Notify extends Pman
'proc' => $p,
'pid' => $info['pid'],
'out' => $tn,
'proc' => $p,
'pid' => $info['pid'],
'out' => $tn,
+ 'oute' => $tne,
'cmd' => $cmd,
'email' => $email,
'pipes' => $pipes,
'cmd' => $cmd,
'email' => $email,
'pipes' => $pipes,
@@
-494,9
+496,10
@@
class Pman_Core_Notify extends Pman
proc_terminate($p['proc'], 9);
//fclose($p['pipes'][1]);
fclose($p['pipes'][0]);
proc_terminate($p['proc'], 9);
//fclose($p['pipes'][1]);
fclose($p['pipes'][0]);
- fclose($p['pipes'][2]);
- $this->logecho("TERMINATING: ({$p['pid']}) {$p['email']} " . $p['cmd'] . " : " . file_get_contents($p['out']));
+
+ $this->logecho("TERMINATING: ({$p['pid']}) {$p['email']} " . $p['cmd'] . " : " . file_get_contents($p['out'])
. " : " . file_get_contents($p['oute'])
);
@unlink($p['out']);
@unlink($p['out']);
+ @unlink($p['oute']);
// schedule again
$w = DB_DataObject::factory($this->table);
// schedule again
$w = DB_DataObject::factory($this->table);
@@
-515,7
+518,6
@@
class Pman_Core_Notify extends Pman
continue;
}
fclose($p['pipes'][0]);
continue;
}
fclose($p['pipes'][0]);
- fclose($p['pipes'][2]);
//echo "CLOSING: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']) . "\n";
//fclose($p['pipes'][1]);
//echo "CLOSING: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']) . "\n";
//fclose($p['pipes'][1]);
@@
-529,6
+531,7
@@
class Pman_Core_Notify extends Pman
//}
$this->logecho("ENDED: ({$p['pid']}) {$p['email']} " . $p['cmd'] . " : " . file_get_contents($p['out']) );
@unlink($p['out']);
//}
$this->logecho("ENDED: ({$p['pid']}) {$p['email']} " . $p['cmd'] . " : " . file_get_contents($p['out']) );
@unlink($p['out']);
+ @unlink($p['oute']);
// at this point we could pop onto the queue the
$this->popQueueDomain($p['email']);
// at this point we could pop onto the queue the
$this->popQueueDomain($p['email']);