weniger ausgaben
This commit is contained in:
parent
590ac40933
commit
aa55caba36
16
c.rb
16
c.rb
|
@ -35,18 +35,16 @@ end
|
||||||
$tor = tor = IO.pipe
|
$tor = tor = IO.pipe
|
||||||
$tos = tos = IO.pipe
|
$tos = tos = IO.pipe
|
||||||
|
|
||||||
if Process.fork
|
Process.fork do
|
||||||
$stdin.reopen tor.first
|
$stdin.reopen tor.first
|
||||||
tor.last.close
|
tor.last.close
|
||||||
$stdout.reopen tos.last
|
$stdout.reopen tos.last
|
||||||
tos.first.close
|
tos.first.close
|
||||||
$stderr.puts( {:ts => ts, :proc => 'c', :machine => machine, :source => source}.inspect)
|
|
||||||
exec 'ssh', machine, 'perl', '-e', File.readall( File.join( libexec, 's.pl')).shdump, source.shdump
|
exec 'ssh', machine, 'perl', '-e', File.readall( File.join( libexec, 's.pl')).shdump, source.shdump
|
||||||
else
|
|
||||||
$stdin.reopen tos.first
|
|
||||||
tos.last.close
|
|
||||||
$stdout.reopen tor.last
|
|
||||||
tor.first.close
|
|
||||||
$stderr.puts( {:ts => ts, :proc => 'c', :exec => 'reciever', :destination => destination}.inspect)
|
|
||||||
exec 'perl', File.join( libexec, 'r.pl'), destination
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
$stdin.reopen tos.first
|
||||||
|
tos.last.close
|
||||||
|
$stdout.reopen tor.last
|
||||||
|
tor.first.close
|
||||||
|
exec 'perl', File.join( libexec, 'r.pl'), destination
|
||||||
|
|
6
r.pl
6
r.pl
|
@ -11,7 +11,7 @@ sub ts {
|
||||||
|
|
||||||
$SIG{CLD} = sub {
|
$SIG{CLD} = sub {
|
||||||
wait;
|
wait;
|
||||||
printf STDERR "{ts: \"".ts."\", proc: \"r\", action: \"exit\", code: $?, error: \"child_died\"}\n";
|
#printf STDERR "{ts: \"".ts."\", proc: \"r\", action: \"exit\", code: $?, error: \"child_died\"}\n";
|
||||||
exit $?;
|
exit $?;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ sub readcmd {
|
||||||
chdir $ARGV[0] or die( "{ts: \"".ts."\", proc: \"r\", error: \"cannot_chdir\", exception: \"$!\"}\n");
|
chdir $ARGV[0] or die( "{ts: \"".ts."\", proc: \"r\", error: \"cannot_chdir\", exception: \"$!\"}\n");
|
||||||
while( my$data = readcmd) {
|
while( my$data = readcmd) {
|
||||||
(my$cmd, my$length) = unpack( 'nN', $data);
|
(my$cmd, my$length) = unpack( 'nN', $data);
|
||||||
print STDERR "{ts: \"".ts."\", cmd: $cmd, length: $length}\n";
|
#print STDERR "{ts: \"".ts."\", cmd: $cmd, length: $length}\n";
|
||||||
read STDIN, $data, $length;
|
read STDIN, $data, $length;
|
||||||
if( 1 == $cmd) {
|
if( 1 == $cmd) {
|
||||||
open( F, '>>', $data) or die( "{ts: \"".ts."\", proc: \"r\", error: \"unable_to_open_file\", message: \"Can't open file <$data>.\"}\n");
|
open( F, '>>', $data) or die( "{ts: \"".ts."\", proc: \"r\", error: \"unable_to_open_file\", message: \"Can't open file <$data>.\"}\n");
|
||||||
|
@ -40,5 +40,5 @@ while( my$data = readcmd) {
|
||||||
die( "{ts: \"".ts."\", proc: \"r\", error: \"unknown_command\", command: $cmd}\n");
|
die( "{ts: \"".ts."\", proc: \"r\", error: \"unknown_command\", command: $cmd}\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print STDERR "{ts: \"".ts."\", proc: \"r\", exit: 0}\n";
|
#print STDERR "{ts: \"".ts."\", proc: \"r\", exit: 0}\n";
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
Loading…
Reference in a new issue