Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
d7a1672f
Commit
d7a1672f
authored
Jul 24, 2003
by
Leigh B. Stoller
Browse files
Add Mike's NFS/LOOPBACK mount changes.
parent
bdd19cd7
Changes
4
Hide whitespace changes
Inline
Side-by-side
tmcd/common/libsetup.pm
View file @
d7a1672f
...
...
@@ -19,7 +19,7 @@ use Exporter;
doaccounts
dorpms
dotarballs
dostartupcmd
install_deltas
bootsetup
nodeupdate
startcmdstatus
whatsmynickname
TBBackGround
TBForkCmd
vnodesetup
dorouterconfig
jailsetup
dojailconfig
Jailed
NFS
Mounts
findiface
jailsetup
dojailconfig
JailedMounts
findiface
tmccdie
tmcctimeout
libsetup_getvnodeid
dotrafficconfig
OPENTMCC
CLOSETMCC
RUNTMCC
MFS
REMOTE
JAILED
...
...
@@ -503,8 +503,9 @@ sub domounts()
}
print
STDOUT
"
Mounting
$remote
on
$local
\n
";
if
(
system
("
$MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$MOUNT
$remote
on
$local
: $!
\n
";
if
(
system
("
$NFSMOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$NFSMOUNT
"
.
"
$remote
on
$local
: $!
\n
";
next
;
}
}
...
...
@@ -535,8 +536,8 @@ sub domounts()
}
print
STDOUT
"
Mounting
$remote
on
$local
\n
";
if
(
system
("
$MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$MOUNT
$remote
on
$local
: $!
\n
";
if
(
system
("
$
NFS
MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$
NFS
MOUNT
$remote
on
$local
: $!
\n
";
next
;
}
...
...
@@ -670,15 +671,15 @@ sub domounts()
}
#
# Aux function called from the mkjail code to do the NFS mounts outside
# of a jail, and return the list of mounts that were created. This
# will hopefully go away some point with better SFS support inside of
# jails. Local only, of course.
# Aux function called from the mkjail code to do mounts outside
# of a jail, and return the list of mounts that were created. Can use
# either NFS or local loopback. Maybe SFS someday. Local only, of course.
#
sub
Jailed
NFS
Mounts
($$)
sub
JailedMounts
($$
$
)
{
my
(
$vid
,
$rootpath
)
=
@_
;
my
(
$vid
,
$rootpath
,
$usenfs
)
=
@_
;
my
@mountlist
=
();
my
$mountstr
;
#
# No NFS mounts on remote nodes.
...
...
@@ -687,6 +688,12 @@ sub JailedNFSMounts($$)
return
();
}
if
(
$usenfs
)
{
$mountstr
=
$NFSMOUNT
;
}
else
{
$mountstr
=
$LOOPBACKMOUNT
;
}
#
# Mount same set of existing mounts. A hack, but this whole NFS thing
# is a serious hack inside jails.
...
...
@@ -694,7 +701,7 @@ sub JailedNFSMounts($$)
dbmopen
(
%MDB
,
TMMOUNTDB
,
0444
);
while
(
my
(
$remote
,
$path
)
=
each
%MDB
)
{
$local
=
"
$rootpath
/
$path
";
$local
=
"
$rootpath$path
";
if
(
!
-
e
$local
)
{
if
(
!
os_mkdir
(
$local
,
"
0770
"))
{
...
...
@@ -703,9 +710,13 @@ sub JailedNFSMounts($$)
}
}
if
(
!
$usenfs
)
{
$remote
=
$path
;
}
print
STDOUT
"
Mounting
$remote
on
$local
\n
";
if
(
system
("
$
MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$
MOUNT
$remote
on
$local
: $!
\n
";
if
(
system
("
$
mountstr
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$
mountstr
$remote
on
$local
: $!
\n
";
next
;
}
push
(
@mountlist
,
$path
);
...
...
@@ -1088,7 +1099,6 @@ sub dohostnames ()
my
$hostline
=
os_etchosts_line
(
$name
,
$ip
,
$aliases
);
print
STDOUT
"
$hostline
\n
";
print
HOSTS
"
$hostline
\n
";
}
else
{
...
...
tmcd/freebsd/liblocsetup.pm
View file @
d7a1672f
...
...
@@ -13,7 +13,7 @@ package liblocsetup;
use
Exporter
;
@ISA
=
"
Exporter
";
@EXPORT
=
qw (
$CP
$EGREP
$MOUNT
$UMOUNT
$TMPASSWD
$SFSSD
$SFSCD
qw (
$CP
$EGREP
$
NFSMOUNT
$LOOPBACK
MOUNT
$UMOUNT
$TMPASSWD
$SFSSD
$SFSCD
os_cleanup_node
os_ifconfig_line
os_etchosts_line
os_setup
os_groupadd
os_useradd
os_userdel
os_usermod
os_mkdir
os_rpminstall_line
os_ifconfig_veth
...
...
@@ -50,7 +50,8 @@ sub JAILED() { return libsetup::JAILED(); }
#
$CP
=
"
/bin/cp
";
$EGREP
=
"
/usr/bin/egrep -s -q
";
$MOUNT
=
"
/sbin/mount -o -b
";
$NFSMOUNT
=
"
/sbin/mount -o -b
";
$LOOPBACKMOUNT
=
"
/sbin/mount -t null
";
$UMOUNT
=
"
/sbin/umount
";
$TMPASSWD
=
"
$ETCDIR
/master.passwd
";
$SFSSD
=
"
/usr/local/sbin/sfssd
";
...
...
@@ -202,7 +203,7 @@ sub os_ifconfig_veth($$$$$;$)
}
$uplines
=
"";
if
(
defined
(
$iface
))
{
$uplines
.=
"
$IFCONFIGBIN
$iface
up
\n
";
$uplines
.=
"
$IFCONFIGBIN
$iface
up
$IFC_100MBS
$IFC_FDUPLEX
\n
";
}
$uplines
.=
"
$IFCONFIGBIN
veth
${id}
create
\n
"
.
"
$IFCONFIGBIN
veth
${id}
vethaddr
$vmac
/
$vtag
"
.
...
...
tmcd/libsetup.pm
View file @
d7a1672f
...
...
@@ -19,7 +19,7 @@ use Exporter;
doaccounts
dorpms
dotarballs
dostartupcmd
install_deltas
bootsetup
nodeupdate
startcmdstatus
whatsmynickname
TBBackGround
TBForkCmd
vnodesetup
dorouterconfig
jailsetup
dojailconfig
Jailed
NFS
Mounts
findiface
jailsetup
dojailconfig
JailedMounts
findiface
tmccdie
tmcctimeout
libsetup_getvnodeid
dotrafficconfig
OPENTMCC
CLOSETMCC
RUNTMCC
MFS
REMOTE
JAILED
...
...
@@ -503,8 +503,9 @@ sub domounts()
}
print
STDOUT
"
Mounting
$remote
on
$local
\n
";
if
(
system
("
$MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$MOUNT
$remote
on
$local
: $!
\n
";
if
(
system
("
$NFSMOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$NFSMOUNT
"
.
"
$remote
on
$local
: $!
\n
";
next
;
}
}
...
...
@@ -535,8 +536,8 @@ sub domounts()
}
print
STDOUT
"
Mounting
$remote
on
$local
\n
";
if
(
system
("
$MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$MOUNT
$remote
on
$local
: $!
\n
";
if
(
system
("
$
NFS
MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$
NFS
MOUNT
$remote
on
$local
: $!
\n
";
next
;
}
...
...
@@ -670,15 +671,15 @@ sub domounts()
}
#
# Aux function called from the mkjail code to do the NFS mounts outside
# of a jail, and return the list of mounts that were created. This
# will hopefully go away some point with better SFS support inside of
# jails. Local only, of course.
# Aux function called from the mkjail code to do mounts outside
# of a jail, and return the list of mounts that were created. Can use
# either NFS or local loopback. Maybe SFS someday. Local only, of course.
#
sub
Jailed
NFS
Mounts
($$)
sub
JailedMounts
($$
$
)
{
my
(
$vid
,
$rootpath
)
=
@_
;
my
(
$vid
,
$rootpath
,
$usenfs
)
=
@_
;
my
@mountlist
=
();
my
$mountstr
;
#
# No NFS mounts on remote nodes.
...
...
@@ -687,6 +688,12 @@ sub JailedNFSMounts($$)
return
();
}
if
(
$usenfs
)
{
$mountstr
=
$NFSMOUNT
;
}
else
{
$mountstr
=
$LOOPBACKMOUNT
;
}
#
# Mount same set of existing mounts. A hack, but this whole NFS thing
# is a serious hack inside jails.
...
...
@@ -694,7 +701,7 @@ sub JailedNFSMounts($$)
dbmopen
(
%MDB
,
TMMOUNTDB
,
0444
);
while
(
my
(
$remote
,
$path
)
=
each
%MDB
)
{
$local
=
"
$rootpath
/
$path
";
$local
=
"
$rootpath$path
";
if
(
!
-
e
$local
)
{
if
(
!
os_mkdir
(
$local
,
"
0770
"))
{
...
...
@@ -703,9 +710,13 @@ sub JailedNFSMounts($$)
}
}
if
(
!
$usenfs
)
{
$remote
=
$path
;
}
print
STDOUT
"
Mounting
$remote
on
$local
\n
";
if
(
system
("
$
MOUNT
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$
MOUNT
$remote
on
$local
: $!
\n
";
if
(
system
("
$
mountstr
$remote
$local
"))
{
warn
"
*** WARNING: Could not
$
mountstr
$remote
on
$local
: $!
\n
";
next
;
}
push
(
@mountlist
,
$path
);
...
...
@@ -1088,7 +1099,6 @@ sub dohostnames ()
my
$hostline
=
os_etchosts_line
(
$name
,
$ip
,
$aliases
);
print
STDOUT
"
$hostline
\n
";
print
HOSTS
"
$hostline
\n
";
}
else
{
...
...
tmcd/linux/liblocsetup.pm
View file @
d7a1672f
...
...
@@ -12,7 +12,7 @@ package liblocsetup;
use
Exporter
;
@ISA
=
"
Exporter
";
@EXPORT
=
qw (
$CP
$EGREP
$MOUNT
$UMOUNT
$TMPASSWD
$SFSSD
$SFSCD
qw (
$CP
$EGREP
$
NFS
MOUNT
$UMOUNT
$TMPASSWD
$SFSSD
$SFSCD
os_cleanup_node
os_ifconfig_line
os_etchosts_line
os_setup
os_groupadd
os_useradd
os_userdel
os_usermod
os_mkdir
os_rpminstall_line
os_ifconfig_veth
...
...
@@ -45,7 +45,7 @@ BEGIN
#
$CP
=
"
/bin/cp
";
$EGREP
=
"
/bin/egrep -q
";
$MOUNT
=
"
/bin/mount
";
$
NFS
MOUNT
=
"
/bin/mount
";
$UMOUNT
=
"
/bin/umount
";
$TMPASSWD
=
"
$ETCDIR
/passwd
";
$SFSSD
=
"
/usr/local/sbin/sfssd
";
...
...
Write
Preview
Supports
Markdown
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