--- trunk/lib/Sack/Server.pm 2009/11/08 12:45:43 178 +++ trunk/lib/Sack/Server.pm 2009/11/08 12:53:15 179 @@ -1,5 +1,7 @@ #!/usr/bin/perl +package Sack::Server; + use warnings; use strict; @@ -11,9 +13,8 @@ use File::Slurp; use Cwd qw(abs_path); -my @cloud = qw(localhost tab.lan llin.lan); - -my $cloud_path = $ENV{CLOUD} || '/srv/Sack/etc/lib'; +my @cloud; +my $cloud_path = $ENV{CLOUD} || die "start with: CLOUD=etc/cloud perl -I/srv/Sack/lib $0\n"; @cloud = read_file $cloud_path; @cloud = map { chomp $_; $_ } @cloud; @@ -33,7 +34,7 @@ push @{ $info->{$port} }, [ @_ ]; } -sub fork_node { +sub fork_ssh { my ( $port, $host ) = @_; if ( my $pid = fork ) { @@ -56,7 +57,7 @@ foreach my $host ( @cloud ) { system "find /srv/Sack/ | cpio --create --dereference | ssh -T -F $cloud_path.ssh $host cpio --extract --make-directories --unconditional"; - fork_node( $node_port++, $host ); + fork_ssh( $node_port++, $host ); } my $session;