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
fb528ba4
Commit
fb528ba4
authored
Oct 20, 2010
by
Leigh B Stoller
Browse files
Change libreboot log file to reboot.log (instead of power.log) and add
logging to the power command (to power.log).
parent
ed65140b
Changes
2
Hide whitespace changes
Inline
Side-by-side
tbsetup/libreboot.pm.in
View file @
fb528ba4
...
...
@@ -65,7 +65,7 @@ my $power = "$TB/bin/power";
my $ipod = "$TB/sbin/apod";
my $vnodesetup = "$TB/sbin/vnode_setup";
my $bisend = "$TB/sbin/bootinfosend";
my $logfile = "$TB/log/
power
.log";
my $logfile = "$TB/log/
reboot
.log";
my $ping = "/sbin/ping";
my $reboot = "$TB/bin/node_reboot";
...
...
tbsetup/power.in
View file @
fb528ba4
...
...
@@ -23,6 +23,7 @@ my $RPCSERVER = "@OUTERBOSS_NODENAME@";
my
$RPCPORT
=
"
@OUTERBOSS_XMLRPCPORT
@
";
my
$RPCCERT
=
"
@OUTERBOSS_SSLCERTNAME
@
";
my
$WOL
=
"
$TB
/sbin/whol
";
my
$logfile
=
"
$TB
/log/power.log
";
use
lib
"
@prefix
@/lib
";
use
libdb
;
...
...
@@ -42,6 +43,7 @@ use StateWait;
use
strict
;
use
English
;
use
Getopt::
Std
;
use
POSIX
qw(strftime)
;
sub
usage
()
{
print
<<
"
END
";
...
...
@@ -71,6 +73,7 @@ my $this_user;
# Protos
sub
dostatus
(@);
sub
dowol
(@);
sub
logit
($);
#
# Process command-line arguments
...
...
@@ -164,6 +167,8 @@ if ($ELABINELAB) {
exit
(
0
)
if
(
!
@nodelist
);
logit
("
$op
:
@nodelist
\n
");
libxmlrpc::
Config
({"
server
"
=>
$RPCSERVER
,
"
verbose
"
=>
1
,
"
cert
"
=>
$RPCCERT
,
...
...
@@ -319,6 +324,8 @@ foreach my $power_id (keys %outlets) {
}
(
$type
,
$IP
,
$class
)
=
$result
->
fetchrow
();
}
# Log now, and not worry about errors. Just want to know we tried.
logit
("
$op
:
@nodes
\n
");
#
# Finally, we look at the controller type and construct the proper type
...
...
@@ -595,6 +602,7 @@ sub dowol(@)
@nodeids
=
keys
(
%macs
);
print
"
Doing a plain WOL to
@nodeids
via interface
$iface
\n
";
logit
("
WOL:
@nodeids
\n
");
#
# This is going to take an arbitrary length of time; we have no idea
...
...
@@ -660,3 +668,14 @@ sub dowol(@)
}
return
0
;
}
sub
logit
($)
{
my
(
$message
)
=
@_
;
my
(
$me
)
=
getpwuid
(
$UID
);
# Sep 20 09:36:00 [$me] $message
open
(
LOG
,"
>>
$logfile
");
print
LOG
strftime
("
%b %e %H:%M:%S
",
localtime
)
.
"
[
$me
]
$message
";
close
(
LOG
);
}
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