Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
112
Issues
112
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
ca9a48c7
Commit
ca9a48c7
authored
Jan 08, 2015
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine the waitmode hack...eh, heuristic.
parent
55388928
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
tbsetup/exports_setup.in
tbsetup/exports_setup.in
+21
-2
No files found.
tbsetup/exports_setup.in
View file @
ca9a48c7
...
...
@@ -169,6 +169,11 @@ if (defined($options{"w"})) {
usage
()
if
(
@ARGV
);
if
(
$ZFS_NOEXPORT
&&
!
$waittildone
)
{
print
"
WARNING: forcing wait mode
\n
";
$waittildone
=
1
;
}
#
# We need to serialize this script to avoid a trashed map file.
#
...
...
@@ -492,6 +497,7 @@ sub sortbyip {
#
# Now spit out each group!
#
my
$lastmount
;
foreach
my
$str
(
keys
(
%
ipgroups
)
)
{
my
@iplist
=
sort
sortbyip
@
{
$ipgroups
{
$str
}
};
...
...
@@ -505,6 +511,7 @@ foreach my $str ( keys(%ipgroups) ) {
print
"
$str
-maproot=
$NFSMAPTOUSER
@iplist
\n
"
if
(
$debug
);
}
$lastmount
=
$str
;
}
if
(
$ZFS_NOEXPORT
)
{
# Build up filesystem sub-lists.
...
...
@@ -534,6 +541,7 @@ if ($ZFS_NOEXPORT) {
print
"
$str
-maproot=
$NFSMAPTOUSER
$BOSSNODE
\n
"
if
(
$debug
);
}
$lastmount
=
$str
;
}
}
...
...
@@ -599,9 +607,20 @@ if (!$TESTMODE) {
# with older mountd's ls will fail,
# with newer mountd's ls will hang til mountd is done.
#
# However, mountd add exports to the kernel as it parses
# the file. So, we really have to look at the last line in
# exports and wait for that FS!
#
if
(
$waittildone
)
{
print
"
WARNING: waiting for mountd to finish...
\n
";
my
$testdir
=
"
/proj/
"
.
TBOPSPID
();
# parse a FS out of the last line or /proj/emulab-ops if none
my
$testdir
;
if
(
$lastmount
&&
$lastmount
=~
/^(\S+)/
)
{
$testdir
=
$1
;
}
else
{
$testdir
=
"
/proj/
"
.
TBOPSPID
();
}
print
"
WARNING: waiting for mountd to finish (
$testdir
)...
\n
";
my
$tries
=
10
;
while
(
$tries
--
>
0
)
{
if
(
system
("
/bin/ls
$testdir
>/dev/null 2>&1
"))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment