/[Sack]/trunk/lib/Sack/Server.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Sack/Server.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 178 by dpavlin, Sun Nov 8 12:45:43 2009 UTC revision 179 by dpavlin, Sun Nov 8 12:53:15 2009 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2    
3    package Sack::Server;
4    
5  use warnings;  use warnings;
6  use strict;  use strict;
7    
# Line 11  use Storable qw(); Line 13  use Storable qw();
13  use File::Slurp;  use File::Slurp;
14  use Cwd qw(abs_path);  use Cwd qw(abs_path);
15    
16  my @cloud = qw(localhost tab.lan llin.lan);  my @cloud;
17    my $cloud_path = $ENV{CLOUD} || die "start with: CLOUD=etc/cloud perl -I/srv/Sack/lib $0\n";
 my $cloud_path = $ENV{CLOUD} || '/srv/Sack/etc/lib';  
18  @cloud = read_file $cloud_path;  @cloud = read_file $cloud_path;
19  @cloud = map { chomp $_; $_ } @cloud;  @cloud = map { chomp $_; $_ } @cloud;
20    
# Line 33  sub info { Line 34  sub info {
34          push @{ $info->{$port} }, [ @_ ];          push @{ $info->{$port} }, [ @_ ];
35  }  }
36    
37  sub fork_node {  sub fork_ssh {
38          my ( $port, $host ) = @_;          my ( $port, $host ) = @_;
39    
40          if ( my $pid = fork ) {          if ( my $pid = fork ) {
# Line 56  my $node_port = 4000; Line 57  my $node_port = 4000;
57    
58  foreach my $host ( @cloud ) {  foreach my $host ( @cloud ) {
59          system "find /srv/Sack/ | cpio --create --dereference | ssh -T -F $cloud_path.ssh $host cpio --extract --make-directories --unconditional";          system "find /srv/Sack/ | cpio --create --dereference | ssh -T -F $cloud_path.ssh $host cpio --extract --make-directories --unconditional";
60          fork_node( $node_port++, $host );          fork_ssh( $node_port++, $host );
61  }  }
62    
63  my $session;  my $session;

Legend:
Removed from v.178  
changed lines
  Added in v.179

  ViewVC Help
Powered by ViewVC 1.1.26