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
111
Issues
111
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
18308791
Commit
18308791
authored
Aug 20, 2002
by
Austin Clements
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cruft removal. Mainly, the unused dosfsmounts command was removed.
parent
ba62c306
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
318 deletions
+0
-318
tmcd/common/libsetup.pm
tmcd/common/libsetup.pm
+0
-136
tmcd/libsetup.pm
tmcd/libsetup.pm
+0
-136
tmcd/tmcd.c
tmcd/tmcd.c
+0
-46
No files found.
tmcd/common/libsetup.pm
View file @
18308791
...
...
@@ -540,49 +540,13 @@ sub dosfshostid ()
my
$myhostid
;
# Do I already have a host key?
# if (-e "/etc/sfs/sfs_host_key") {
# print STDOUT " This node already has a host key\n";
# }
# else {
# # Create my host key
# if (! -e "/etc/sfs") {
# if (! os_mkdir("/etc/sfs", 0755)) {
# warn "*** WARNING: Could not make directory /etc/sfs: $!\n";
# }
# }
# if (! -e "/etc/sfs/sfs_host_key") {
# print STDOUT " Creating SFS host key\n";
# if (system("sfskey gen -KPn $vname.$eid.$pid ".
# "/etc/sfs/sfs_host_key")) {
# warn "*** WARNING: Could not generate SFS host key: $!\n";
# $USESFS = 0;
# return 1;
# }
# }
# }
if
(
!
-
e
"
/etc/sfs/sfs_host_key
")
{
warn
"
*** This node does not have a host key, skipping SFS stuff
\n
";
$USESFS
=
0
;
return
1
;
}
# Start SFS server and client (this has to be done now, as opposed
# to in an rc script, because the hostkey has to exist)
# if (system($SFSSD)) {
# warn "*** Failed to start sfssd\n";
# $USESFS = 0;
# return 1;
# }
# if (system($SFSCD)) {
# warn "*** Failed to start sfscd\n";
# $USESFS = 0;
# return 1;
# }
# Give hostid to TMCD
# IAMHERE: sfssd needs to be running for this call to succeed
# Directory needs to exist on fs/proj
open
(
SFSKEY
,
"
sfskey hostid - |
")
or
die
"
Cannot start sfskey
";
$myhostid
=
<
SFSKEY
>
;
...
...
@@ -605,106 +569,6 @@ sub dosfshostid ()
return
0
;
}
#
# Create SFS "mounts" (which are really just symlinks). The remote side
# of the mount is relative to /sfs and includes the server hostname, the
# server's hostid, and the path on the server. The local side is simply
# the path relative to / to symlink to the remote sfs directory. This
# closely follows domounts()
#
sub
dosfsmounts
()
{
my
$TM
;
my
%
MBD
;
my
%
mounts
;
my
%
deletes
;
die
("
*** Don't call dosfsmounts!
");
$TM
=
OPENTMCC
(
TMCCCMD_SFSMOUNTS
);
while
(
<
$TM
>
)
{
if
(
$_
=~
/REMOTE=([-:\@\w\.\/]+) LOCAL=([-\@\w\.\/]+)/
)
{
$mounts
{
$1
}
=
$2
;
}
}
CLOSETMCC
(
$TM
);
dbmopen
(
%
MDB
,
TMSFSMOUNTDB
,
0660
);
#
# First symlink all the mounts we are told to. For each one that is
# not currently symlinked, and can be, add it to the DB.
#
while
((
$remote
,
$local
)
=
each
%
mounts
)
{
if
(
-
l
$local
&&
readlink
(
$local
)
eq
("
/sfs/
"
.
$remote
))
{
$MDB
{
$remote
}
=
$local
;
next
;
}
if
(
!
-
l
$local
)
{
print
STDOUT
"
Unlinking incorrect symlink
$local
\n
";
if
(
!
unlink
(
$local
))
{
warn
"
*** WARNING: Could not unlink
$local
: $!
\n
";
next
;
}
}
$dir
=
$local
;
$dir
=~
s/(.*)\/[^\/]*$/$1/
;
if
(
!
-
e
$dir
)
{
print
STDOUT
"
Making directory
$dir
\n
";
if
(
!
os_mkdir
(
$dir
,
755
))
{
warn
"
*** WARNING: Could not make directory
$local
: $!
\n
";
next
;
}
}
print
STDOUT
"
Symlinking
$remote
on
$local
\n
";
if
(
!
symlink
("
/sfs/
"
.
$remote
,
$local
))
{
warn
"
*** WARNING: Could not make symlink
$local
: $!
\n
";
next
;
}
$MDB
{
$remote
}
=
$local
;
}
#
# Now delete the ones that we symlinked previously, but are now no
# longer in the mount set (as told to us by the TMCD). Note, we
# cannot delete them directly from MDB since that would mess up the
# foreach loop, so just stick them in temp and postpass it.
#
while
((
$remote
,
$local
)
=
each
%
MDB
)
{
if
(
defined
(
$mounts
{
$remote
}))
{
next
;
}
if
(
!
-
e
$local
)
{
$deletes
{
$remote
}
=
$local
;
next
;
}
print
STDOUT
"
Deleting symlink
$local
\n
";
if
(
!
unlink
(
$local
))
{
warn
"
*** WARNING: Could not delete
$local
: $!
\n
";
next
;
}
#
# Only delete from set if we can actually unlink it. This way
# we can retry it later (or next time).
#
$deletes
{
$remote
}
=
$local
;
}
while
((
$remote
,
$local
)
=
each
%
deletes
)
{
delete
(
$MDB
{
$remote
});
}
# Write the DB back out!
dbmclose
(
%
MDB
);
return
0
;
}
#
# Do interface configuration.
# Write a file of ifconfig lines, which will get executed.
...
...
tmcd/libsetup.pm
View file @
18308791
...
...
@@ -540,49 +540,13 @@ sub dosfshostid ()
my
$myhostid
;
# Do I already have a host key?
# if (-e "/etc/sfs/sfs_host_key") {
# print STDOUT " This node already has a host key\n";
# }
# else {
# # Create my host key
# if (! -e "/etc/sfs") {
# if (! os_mkdir("/etc/sfs", 0755)) {
# warn "*** WARNING: Could not make directory /etc/sfs: $!\n";
# }
# }
# if (! -e "/etc/sfs/sfs_host_key") {
# print STDOUT " Creating SFS host key\n";
# if (system("sfskey gen -KPn $vname.$eid.$pid ".
# "/etc/sfs/sfs_host_key")) {
# warn "*** WARNING: Could not generate SFS host key: $!\n";
# $USESFS = 0;
# return 1;
# }
# }
# }
if
(
!
-
e
"
/etc/sfs/sfs_host_key
")
{
warn
"
*** This node does not have a host key, skipping SFS stuff
\n
";
$USESFS
=
0
;
return
1
;
}
# Start SFS server and client (this has to be done now, as opposed
# to in an rc script, because the hostkey has to exist)
# if (system($SFSSD)) {
# warn "*** Failed to start sfssd\n";
# $USESFS = 0;
# return 1;
# }
# if (system($SFSCD)) {
# warn "*** Failed to start sfscd\n";
# $USESFS = 0;
# return 1;
# }
# Give hostid to TMCD
# IAMHERE: sfssd needs to be running for this call to succeed
# Directory needs to exist on fs/proj
open
(
SFSKEY
,
"
sfskey hostid - |
")
or
die
"
Cannot start sfskey
";
$myhostid
=
<
SFSKEY
>
;
...
...
@@ -605,106 +569,6 @@ sub dosfshostid ()
return
0
;
}
#
# Create SFS "mounts" (which are really just symlinks). The remote side
# of the mount is relative to /sfs and includes the server hostname, the
# server's hostid, and the path on the server. The local side is simply
# the path relative to / to symlink to the remote sfs directory. This
# closely follows domounts()
#
sub
dosfsmounts
()
{
my
$TM
;
my
%
MBD
;
my
%
mounts
;
my
%
deletes
;
die
("
*** Don't call dosfsmounts!
");
$TM
=
OPENTMCC
(
TMCCCMD_SFSMOUNTS
);
while
(
<
$TM
>
)
{
if
(
$_
=~
/REMOTE=([-:\@\w\.\/]+) LOCAL=([-\@\w\.\/]+)/
)
{
$mounts
{
$1
}
=
$2
;
}
}
CLOSETMCC
(
$TM
);
dbmopen
(
%
MDB
,
TMSFSMOUNTDB
,
0660
);
#
# First symlink all the mounts we are told to. For each one that is
# not currently symlinked, and can be, add it to the DB.
#
while
((
$remote
,
$local
)
=
each
%
mounts
)
{
if
(
-
l
$local
&&
readlink
(
$local
)
eq
("
/sfs/
"
.
$remote
))
{
$MDB
{
$remote
}
=
$local
;
next
;
}
if
(
!
-
l
$local
)
{
print
STDOUT
"
Unlinking incorrect symlink
$local
\n
";
if
(
!
unlink
(
$local
))
{
warn
"
*** WARNING: Could not unlink
$local
: $!
\n
";
next
;
}
}
$dir
=
$local
;
$dir
=~
s/(.*)\/[^\/]*$/$1/
;
if
(
!
-
e
$dir
)
{
print
STDOUT
"
Making directory
$dir
\n
";
if
(
!
os_mkdir
(
$dir
,
755
))
{
warn
"
*** WARNING: Could not make directory
$local
: $!
\n
";
next
;
}
}
print
STDOUT
"
Symlinking
$remote
on
$local
\n
";
if
(
!
symlink
("
/sfs/
"
.
$remote
,
$local
))
{
warn
"
*** WARNING: Could not make symlink
$local
: $!
\n
";
next
;
}
$MDB
{
$remote
}
=
$local
;
}
#
# Now delete the ones that we symlinked previously, but are now no
# longer in the mount set (as told to us by the TMCD). Note, we
# cannot delete them directly from MDB since that would mess up the
# foreach loop, so just stick them in temp and postpass it.
#
while
((
$remote
,
$local
)
=
each
%
MDB
)
{
if
(
defined
(
$mounts
{
$remote
}))
{
next
;
}
if
(
!
-
e
$local
)
{
$deletes
{
$remote
}
=
$local
;
next
;
}
print
STDOUT
"
Deleting symlink
$local
\n
";
if
(
!
unlink
(
$local
))
{
warn
"
*** WARNING: Could not delete
$local
: $!
\n
";
next
;
}
#
# Only delete from set if we can actually unlink it. This way
# we can retry it later (or next time).
#
$deletes
{
$remote
}
=
$local
;
}
while
((
$remote
,
$local
)
=
each
%
deletes
)
{
delete
(
$MDB
{
$remote
});
}
# Write the DB back out!
dbmclose
(
%
MDB
);
return
0
;
}
#
# Do interface configuration.
# Write a file of ifconfig lines, which will get executed.
...
...
tmcd/tmcd.c
View file @
18308791
...
...
@@ -112,7 +112,6 @@ COMMAND_PROTOTYPE(doreadycount);
COMMAND_PROTOTYPE
(
dolog
);
COMMAND_PROTOTYPE
(
domounts
);
COMMAND_PROTOTYPE
(
dosfshostid
);
//COMMAND_PROTOTYPE(dosfsmounts);
COMMAND_PROTOTYPE
(
doloadinfo
);
COMMAND_PROTOTYPE
(
doreset
);
COMMAND_PROTOTYPE
(
dorouting
);
...
...
@@ -147,7 +146,6 @@ struct command {
{
"log"
,
dolog
},
{
"mounts"
,
domounts
},
{
"sfshostid"
,
dosfshostid
},
// { "sfsmounts", dosfsmounts },
{
"loadinfo"
,
doloadinfo
},
{
"reset"
,
doreset
},
{
"routing"
,
dorouting
},
...
...
@@ -2278,8 +2276,6 @@ COMMAND_PROTOTYPE(dosfshostid)
if
(
nodeidtonickname
(
nodeid
,
nickname
))
strcpy
(
nickname
,
nodeid
);
/* XXX Make sure that the dirsearch dir exists (more NFS goop) */
/*
* Create symlink names
*/
...
...
@@ -2314,48 +2310,6 @@ COMMAND_PROTOTYPE(dosfshostid)
return
0
;
}
/*
* Return SFS-based mounts.
* XXX This is _completely_ unused, and will be removed.
*/
COMMAND_PROTOTYPE
(
dosfsmounts
)
{
char
pid
[
64
];
char
eid
[
64
];
char
gid
[
64
];
char
buf
[
MYBUFSIZE
];
/*
* Now check reserved table
*/
if
(
nodeidtoexp
(
nodeid
,
pid
,
eid
,
gid
))
{
error
(
"MOUNTS: %s: Node is free
\n
"
,
nodeid
);
return
1
;
}
if
(
strlen
(
fshostid
))
{
/*
* Return project mount first.
*/
sprintf
(
buf
,
"REMOTE=%s%s/%s LOCAL=%s/%s
\n
"
,
fshostid
,
FSDIR_PROJ
,
pid
,
PROJDIR
,
pid
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
/*
* If pid!= gid, then this is group experiment, and we return
* a mount for the group directory too.
*/
if
(
strcmp
(
pid
,
gid
))
{
sprintf
(
buf
,
"REMOTE=%s%s/%s/%s LOCAL=%s/%s/%s
\n
"
,
fshostid
,
FSDIR_GROUPS
,
pid
,
gid
,
GROUPDIR
,
pid
,
gid
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
}
}
return
0
;
}
/*
* Return routing stuff.
*/
...
...
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