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
94d9294f
Commit
94d9294f
authored
Apr 23, 2010
by
Ryan Jackson
Browse files
Script for pushing /tftpboot changes out to subbosses automatically
parent
9a54d64e
Changes
2
Hide whitespace changes
Inline
Side-by-side
utils/GNUmakefile.in
View file @
94d9294f
...
@@ -25,7 +25,7 @@ SBIN_SCRIPTS = vlandiff vlansync withadminprivs export_tables cvsupd.pl \
...
@@ -25,7 +25,7 @@ SBIN_SCRIPTS = vlandiff vlansync withadminprivs export_tables cvsupd.pl \
spewconlog opsdb_control newnode suchown archive_list \
spewconlog opsdb_control newnode suchown archive_list \
wanodecheckin wanodecreate spewimage \
wanodecheckin wanodecreate spewimage \
anonsendmail epmodeset fixexpinfo node_traffic \
anonsendmail epmodeset fixexpinfo node_traffic \
dumpdescriptor
dumpdescriptor
subboss_tftpboot_sync
WEB_SBIN_SCRIPTS= webnewnode webdeletenode webspewconlog webarchive_list \
WEB_SBIN_SCRIPTS= webnewnode webdeletenode webspewconlog webarchive_list \
webwanodecheckin webspewimage
webwanodecheckin webspewimage
...
...
utils/subboss_tftpboot_sync.in
0 → 100644
View file @
94d9294f
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
# un-taint path
$ENV
{'
PATH
'}
=
'
/bin:/usr/bin:/usr/sbin:/usr/local/bin
';
delete
@ENV
{'
IFS
',
'
CDPATH
',
'
ENV
',
'
BASH_ENV
'};
use
lib
"
@prefix
@/lib
";
use
libdb
;
use
libtestbed
;
my
$excludes
=
'
/usr/local/etc/subboss_tftpboot_sync.excludes
';
sub
sync_tftpboot
($)
{
my
(
$node_id
)
=
@_
;
my
$rsync_opts
=
'
-r -l
';
if
(
-
r
$excludes
)
{
$rsync_opts
.=
"
--exclude-from=
$excludes
";
}
system
("
rsync
$rsync_opts
/tftpboot
$node_id
:/tftpboot
");
}
my
$query_result
=
DBQueryWarn
("
select n.node_id from nodes as n left join reserved as r on
"
.
"
n.node_id = r.node_id left join subbosses as s on
"
.
"
n.node_id = s.subboss_id where r.erole = 'subboss' and
"
.
"
s.service = 'tftp' and n.eventstate = 'ISUP'
");
if
(
!
$query_result
)
{
fatal
("
Could not subboss data from DB!
");
}
while
(
my
%row
=
$query_result
->
fetchhash
())
{
sync_tftpboot
(
$row
{"
node_id
"});
}
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