5 use Data::Dump qw(dump);
9 my ( undef, undef, $uid, $gid, undef, undef, $email, $dir, $shell ) = getpwnam $login;
14 my $worker = Gearman::Worker->new;
15 $worker->job_servers('127.0.0.1:4730');
17 die "missing ZSLICE from env" unless $ENV{ZSLICE};
24 my $zfs = sprintf $fmt, split(/ /,$work);
25 warn "# zfs_get [$work] -> $zfs\n";
30 warn "# $work = $v\n";
35 my $name = $ENV{ZSLICE};
38 $worker->register_function( $name . '_quota_get' => sub { zfs(
39 "zfs get -H -p -o value userused\@u%s $ENV{ZSLICE}" => $_[0]
42 $worker->register_function( $name . '_quota_set' => sub { zfs(
43 "zfs set userquota\@u%s=%s $ENV{ZSLICE}" => $_[0]
46 warn "$0 $name pid $$ waitng for jobs ZFS slice $ENV{ZSLICE}\n";
47 $worker->work while 1;