sub slice_dir_port {
my ($self,$slice) = @_;
my ( undef, $dir, $port, undef ) = getgrnam($slice);
+ die "getgrnam $slice: $!" if $!;
warn "# slice_dir_port $slice = $dir $port\n";
return ( $dir, $port );
}
close($fh);
my $slice = $ENV{SLICE} || 's1';
+ $slice =~ s{/.+/(\w+)$}{$1};
my ( $dir, $port ) = $self->slice_dir_port( $slice );
+ $dir ||= $ENV{SLICE};
+ $port ||= 6501;
+
if ( ! $found ) {
$max_uid++;
$dir .= "/$max_uid";
# FIXME update quota only on create?
$self->gearman_do( $self->dir2gearman( $dir, 'quota', 'set' ) => "$found $new_quota" );
- return $found;
+ return 'u' . $found;
}
sub mkbasepath {
$self->append( $t, 'recv', $size, $f->{uid}, $t_path );
$self->append_meta('md5sum', $t, $md5 => $t_path ) if $md5; # md5sum for received files! FIXME -- cross-slice md5
$self->refresh_file_list( $t );
+ } else {
+ warn "ERROR: send_file $f_full -> $t_full: $!";
}
return $size;
my $full_path = "$user->{dir}/.meta/files";
if ( -e $full_path ) {
warn "## refresh_file_list $full_path";
- unlink $full_path;
+ unlink $full_path || warn "unlink $full_path: $!";
+ } else {
+ warn "## refresh_file_list $full_path missing";
}
}