Commit 58ce4cc9 authored by Leigh Stoller's avatar Leigh Stoller

Make a complete dir hierarchy under the group directory so it looks

just like /proj/$pid.
parent 9c3191b7
...@@ -36,6 +36,7 @@ my $PROJROOT = "/proj"; ...@@ -36,6 +36,7 @@ my $PROJROOT = "/proj";
my $GRPROOT = "/groups"; my $GRPROOT = "/groups";
my $SSH = "$TB/bin/sshtb"; my $SSH = "$TB/bin/sshtb";
my $GROUPADD = "/usr/sbin/pw groupadd"; my $GROUPADD = "/usr/sbin/pw groupadd";
my @DIRLIST = ("exp", "images", "logs", "tarfiles", "rpms", "tiplogs");
my $dbuid; my $dbuid;
my @db_row; my @db_row;
...@@ -240,8 +241,25 @@ if ($pid ne $gid) { ...@@ -240,8 +241,25 @@ if ($pid ne $gid) {
symlink($groupdir, $grouplink) or symlink($groupdir, $grouplink) or
fatal("Could not symlink($groupdir, $grouplink): $!"); fatal("Could not symlink($groupdir, $grouplink): $!");
} }
}
#
# Make group subdirs.
#
foreach my $dir (@DIRLIST) {
if (! -e "$groupdir/$dir") {
if (! mkdir("$groupdir/$dir", 0770)) {
fatal("Could not make directory $groupdir/$dir: $!");
}
if (! chmod(0770, "$groupdir/$dir")) {
fatal("Could not chmod directory $groupdir/$dir: $!");
}
if (! chown($unix_uid, $unix_gid, "$groupdir/$dir")) {
fatal("Could not chown $groupdir/$dir: $!");
}
}
}
}
print "Group Creation Completed!\n"; print "Group Creation Completed!\n";
exit(0); exit(0);
......
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