Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
a2ae7028
Commit
a2ae7028
authored
Jun 21, 2010
by
Ryan Jackson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return frisbee server IP in loadinfo
parent
c8f791b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
11 deletions
+27
-11
tmcd/decls.h
tmcd/decls.h
+1
-1
tmcd/freebsd/rc.frisbee
tmcd/freebsd/rc.frisbee
+4
-5
tmcd/linux/rc.frisbee
tmcd/linux/rc.frisbee
+6
-3
tmcd/tmcd.c
tmcd/tmcd.c
+16
-2
No files found.
tmcd/decls.h
View file @
a2ae7028
...
...
@@ -26,4 +26,4 @@
* NB: See ron/libsetup.pm. That is version 4! I'll merge that in.
*/
#define DEFAULT_VERSION 2
#define CURRENT_VERSION 3
0
#define CURRENT_VERSION 3
1
tmcd/freebsd/rc.frisbee
View file @
a2ae7028
...
...
@@ -140,6 +140,8 @@ loadone() {
echo
"Loading image #
$NUM
"
ADDRESS
=
`
echo
$LOADINFO
|
sed
-e
's/.*ADDR=\([^[:space:]]*\).*/\1/'
`
SERVER
=
`
echo
$LOADINFO
|
sed
-e
's/.*SERVER=\([^[:space:]]*\).*/\1/'
`
SERVER
=
${
SERVER
:-
$BOSSIP
}
PARTITION
=
`
echo
$LOADINFO
|
sed
-e
's/.*PART=\([^[:space:]]*\).*/\1/'
`
PARTITION
=
${
PARTITION
:-
'0'
}
PARTOS
=
`
echo
$LOADINFO
|
sed
-e
's/.*PARTOS=\([^[:space:]]*\).*/\1/'
`
...
...
@@ -339,8 +341,8 @@ loadone() {
echo
"Running /usr/local/bin/imageunzip -o -O -W 32
$ZFILL
$imagefile
/dev/
${
DISK
}
s
${
PARTITION
}
"
/usr/local/bin/imageunzip
-o
-O
-W
32
$ZFILL
$imagefile
/dev/
${
DISK
}
s
${
PARTITION
}
else
echo
"Running
$BINDIR
/frisbee
$LOADIP
$MEMARGS
$ZFILL
$SLICE
$MCASTIF
$MCASTADDR
/dev/
$DISK
at
`
date
`
"
$BINDIR
/frisbee
$LOADIP
$MEMARGS
$ZFILL
$SLICE
$MCASTIF
$MCASTADDR
/dev/
$DISK
echo
"Running
$BINDIR
/frisbee
-S
$SERVER
$MEMARGS
$ZFILL
$SLICE
$MCASTIF
$MCASTADDR
/dev/
$DISK
at
`
date
`
"
$BINDIR
/frisbee
-S
$SERVER
$MEMARGS
$ZFILL
$SLICE
$MCASTIF
$MCASTADDR
/dev/
$DISK
fi
fstat
=
$?
...
...
@@ -395,9 +397,6 @@ STATUS=`$BINDIR/tmcc status`
BOSSIP
=
`
echo
$BOSSINFO
|
awk
'{ print $2 }'
`
# XXX should be part of loadinfo
LOADIP
=
"-S
$BOSSIP
"
if
[
-x
/usr/sbin/ntpdate
]
;
then
/usr/sbin/ntpdate
-b
$BOSSIP
>
/dev/null 2>&1
fi
...
...
tmcd/linux/rc.frisbee
View file @
a2ae7028
...
...
@@ -133,6 +133,7 @@ write_image()
local
slice
=
$3
local
zfill
=
$4
local
ptype
=
$5
local
server
=
$6
local
port
=
""
local
imagefile
=
""
local
frisbee_opts
=
"
$FRISBEE_OPTS
"
...
...
@@ -207,7 +208,8 @@ write_image()
$BINDIR
/tmcc state RELOADING
if
[
$protocol
=
frisbee
]
;
then
$BINDIR
/frisbee
-m
$address
-p
$port
$frisbee_opts
$disk
[
-n
"
$server
"
]
||
server
=
$BOSSIP
$BINDIR
/frisbee
-m
$address
-p
$port
-S
$server
$frisbee_opts
$disk
rc
=
$?
if
[
$rc
-ne
0
]
;
then
...
...
@@ -233,6 +235,7 @@ handle_loadinfo()
{
local
LOADINFO
=
"
$@
"
local
ADDRESS
=
`
get_value
"
$LOADINFO
"
ADDR
`
local
SERVER
=
`
get_value
"
$LOADINFO
"
SERVER
`
local
PARTOS
=
`
get_value
"
$LOADINFO
"
PARTOS
`
local
PARTITION
=
`
get_value
"
$LOADINFO
"
PART
`
PARTITION
=
${
PARTITION
:-
'0'
}
...
...
@@ -305,7 +308,7 @@ handle_loadinfo()
zapsuperblocks /dev/
$DISK
fi
write_image
$ADDRESS
/dev/
$DISK
$PARTITION
$ZFILL
$PTYPE
write_image
$ADDRESS
/dev/
$DISK
$PARTITION
$ZFILL
$PTYPE
$SERVER
rc
=
$?
if
[
$rc
-ne
0
]
;
then
echo
"Failed to write image to disk, status
$rc
"
...
...
@@ -397,7 +400,7 @@ $BINDIR/get_edd_map > $BOOTDIR/edd_map 2>/dev/null
FRISBEE_OPTS
=
"-S
$BOSSIP
"
if
[
-e
$BOOTDIR
/myip
]
;
then
FRISBEE_OPTS
=
"
$FRISBEE_OPTS
-i
`
cat
$BOOTDIR
/myip
`
"
FRISBEE_OPTS
=
"-i
`
cat
$BOOTDIR
/myip
`
"
fi
IMAGEUNZIP_OPTS
=
"-o -O -W 32"
...
...
tmcd/tmcd.c
View file @
a2ae7028
...
...
@@ -3841,6 +3841,7 @@ COMMAND_PROTOTYPE(doloadinfo)
char
buf
[
MYBUFSIZE
];
char
*
bufp
=
buf
,
*
ebufp
=
&
buf
[
sizeof
(
buf
)];
char
*
disktype
,
*
useacpi
,
*
useasf
,
address
[
MYBUFSIZE
];
char
server_address
[
MYBUFSIZE
];
char
mbrvers
[
51
];
char
*
loadpart
,
*
OS
,
*
prepare
;
int
disknum
,
nrows
,
zfill
;
...
...
@@ -3912,11 +3913,12 @@ COMMAND_PROTOTYPE(doloadinfo)
OS
=
row
[
2
];
prepare
=
row
[
8
];
res2
=
mydb_query
(
"select load_address,frisbee_pid from subboss_images as i "
res2
=
mydb_query
(
"select load_address,frisbee_pid
,IP
from subboss_images as i "
"left join subbosses as s on s.subboss_id = i.subboss_id "
"left join interfaces as n on n.node_id = s.subboss_id "
"where s.node_id = '%s' and s.service = 'frisbee' and "
"i.imageid = '%s' and i.load_address != '' and "
"i.sync != 1"
,
2
,
reqp
->
nodeid
,
row
[
7
]);
"
n.role='ctrl' and
i.sync != 1"
,
3
,
reqp
->
nodeid
,
row
[
7
]);
if
(
!
res2
)
{
error
(
"doloadinfo: %s: DB Error getting subboss info!
\n
"
,
...
...
@@ -3927,6 +3929,7 @@ COMMAND_PROTOTYPE(doloadinfo)
frisbee_pid
=
0
;
address
[
0
]
=
'\0'
;
server_address
[
0
]
=
'\0'
;
if
(
mysql_num_rows
(
res2
))
{
row2
=
mysql_fetch_row
(
res2
);
...
...
@@ -3936,12 +3939,16 @@ COMMAND_PROTOTYPE(doloadinfo)
if
(
row2
[
1
]
&&
row2
[
1
][
0
])
frisbee_pid
=
atoi
(
row2
[
1
]);
strcpy
(
server_address
,
row2
[
2
]);
}
else
{
if
(
row
[
0
]
&&
row
[
0
][
0
])
strcpy
(
address
,
row
[
0
]);
if
(
row
[
3
]
&&
row
[
3
][
0
])
frisbee_pid
=
atoi
(
row
[
3
]);
strcpy
(
server_address
,
BOSSNODE_IP
);
}
mysql_free_result
(
res2
);
...
...
@@ -3960,6 +3967,8 @@ COMMAND_PROTOTYPE(doloadinfo)
OUTPUT
(
address
,
sizeof
(
address
),
"%s/spewimage.php?imageid=%s&access_key=%s"
,
TBBASE
,
row
[
7
],
row
[
6
]);
server_address
[
0
]
=
0
;
}
else
{
/*
...
...
@@ -3984,6 +3993,11 @@ COMMAND_PROTOTYPE(doloadinfo)
bufp
+=
OUTPUT
(
bufp
,
ebufp
-
bufp
,
"ADDR=%s PART=%s PARTOS=%s"
,
address
,
loadpart
,
OS
);
if
(
server_address
[
0
]
&&
(
vers
>=
31
))
{
bufp
+=
OUTPUT
(
bufp
,
ebufp
-
bufp
,
" SERVER=%s"
,
server_address
);
}
/*
* Remember zero-fill free space, mbr version fields, and access_key
...
...
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