Commit 30ede0ce authored by Leigh B Stoller's avatar Leigh B Stoller

ZFS_NOEXPORT changes; must force new project and user directories to

be exported after creation, so that mkproj and tbacct can proceed.
parent 70d2a651
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -62,6 +62,7 @@ my $TBAUDIT = "@TBAUDITEMAIL@";
my $CONTROL = "@USERNODE@";
my $BOSSNODE = "@BOSSNODE@";
my $WITHZFS = @WITHZFS@;
my $ZFS_NOEXPORT= @ZFS_NOEXPORT@;
my $WITHSFS = @SFSSUPPORT@;
my $WIKISUPPORT = @WIKISUPPORT@;
my $TRACSUPPORT = @TRACSUPPORT@;
......@@ -474,6 +475,16 @@ sub AddUser()
}
}
if ($WITHZFS) {
if ($ZFS_NOEXPORT) {
#
# Have to force the new directories to be exported.
# See ZFS code in exports_setup
#
$target_user->BumpActivity();
system($EXPORTSSETUP) == 0 or
fatal("$EXPORTSSETUP failed");
}
#
# There is some lag before the automounter can mount the new
# volume. Lets delay until we can access the directory.
......
......@@ -256,6 +256,20 @@ if ($WITHZFS && $ZFS_NOEXPORT) {
$bossexports{"$projdir/$pid"} = "$projdir/$pid";
$bossexports{"$groupdir/$pid"} = "$groupdir/$pid";
}
#
# Similar to above, but look for active projects instead of users.
# We often have to access project directories when there is
# no active experiment or user.
#
$active_result =
DBQueryFatal("select pid from project_stats ".
"where ((UNIX_TIMESTAMP(now()) - ".
" UNIX_TIMESTAMP(last_activity)) <= $limit) and ".
" approved=1");
while (my ($pid) = $active_result->fetchrow_array()) {
$bossexports{"$projdir/$pid"} = "$projdir/$pid";
$bossexports{"$groupdir/$pid"} = "$groupdir/$pid";
}
}
my %ipgroups = ();
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -58,11 +58,13 @@ my $OPSDBSUPPORT= @OPSDBSUPPORT@;
my $TBBASE = "@TBBASE@";
my $TBWWW = "@TBWWW@";
my $WITHZFS = @WITHZFS@;
my $ZFS_NOEXPORT= @ZFS_NOEXPORT@;
my $SSH = "$TB/bin/sshtb";
my $ADDMMLIST = "$TB/sbin/addmmlist";
my $OPSDBCONTROL= "$TB/sbin/opsdb_control";
my $GROUPADD = "/usr/sbin/pw groupadd";
my $ACCOUNTPROXY= "$TB/sbin/accountsetup";
my $EXPORTSSETUP= "$TB/sbin/exports_setup";
my @DIRLIST = ("exp", "images", "logs", "tarfiles", "rpms", "tiplogs");
my $SAVEUID = $UID;
......@@ -210,7 +212,17 @@ if (system("$SSH -host $control_node ".
" $ACCOUNTPROXY $proxy_command $gid $unix_name $unix_gid")) {
fatal("Could not add $unix_name ($unix_gid) to $control_node!\n");
}
if ($WITHZFS && $pid ne $gid) {
if ($WITHZFS) {
if ($ZFS_NOEXPORT) {
#
# Have to force the new directories to be exported.
# See ZFS code in exports_setup
#
$project->BumpActivity();
system($EXPORTSSETUP) == 0 or
fatal("$EXPORTSSETUP failed");
}
#
# There is some lag before the automounter can mount the new
# volume. Lets delay until we can access the project directory.
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment