76 |
carp "mount needs 'dsn' to connect to (e.g. dsn => 'DBI:Pg:dbname=test')" unless ($arg->{'dsn'}); |
carp "mount needs 'dsn' to connect to (e.g. dsn => 'DBI:Pg:dbname=test')" unless ($arg->{'dsn'}); |
77 |
carp "mount needs 'mount' as mountpoint" unless ($arg->{'mount'}); |
carp "mount needs 'mount' as mountpoint" unless ($arg->{'mount'}); |
78 |
|
|
79 |
|
# save (some) arguments in self |
80 |
|
$self->{$_} = $arg->{$_} foreach (qw(mount)); |
81 |
|
|
82 |
foreach (qw(filenames read update)) { |
foreach (qw(filenames read update)) { |
83 |
carp "mount needs '$_' SQL" unless ($arg->{$_}); |
carp "mount needs '$_' SQL" unless ($arg->{$_}); |
84 |
} |
} |
115 |
); |
); |
116 |
} ); |
} ); |
117 |
|
|
118 |
|
confess "Fuse::main failed" if (! $self->{'proc'}->poll); |
119 |
|
|
120 |
$self ? return $self : return undef; |
$self ? return $self : return undef; |
121 |
}; |
}; |
122 |
|
|
135 |
my $self = shift; |
my $self = shift; |
136 |
|
|
137 |
confess "no process running?" unless ($self->{'proc'}); |
confess "no process running?" unless ($self->{'proc'}); |
138 |
$self->{'proc'}->kill; |
|
139 |
|
system "fusermount -u ".$self->{'mount'} || croak "umount error: $!"; |
140 |
|
|
141 |
|
if ($self->{'proc'}->poll) { |
142 |
|
$self->{'proc'}->kill; |
143 |
|
return 1 if (! $self->{'proc'}->poll); |
144 |
|
} else { |
145 |
|
return 1; |
146 |
|
} |
147 |
} |
} |
148 |
|
|
149 |
|
|