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-stable
Commits
65dcf7a7
Commit
65dcf7a7
authored
Jan 07, 2010
by
Leigh B. Stoller
Browse files
Fixes for newsyslog; need to flip back to root to reopen the
log file.
parent
fcd6e476
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/checknodes_daemon.in
View file @
65dcf7a7
...
@@ -16,8 +16,9 @@ sub usage()
...
@@ -16,8 +16,9 @@ sub usage()
print
"
Usage: checknodes_daemon [-d]
\n
";
print
"
Usage: checknodes_daemon [-d]
\n
";
exit
(
1
);
exit
(
1
);
}
}
my
$optlist
=
"
d
";
my
$optlist
=
"
d
n
";
my
$debug
=
0
;
my
$debug
=
0
;
my
$impotent
=
0
;
#
#
# Configure variables
# Configure variables
...
@@ -64,6 +65,9 @@ if (! getopts($optlist, \%options)) {
...
@@ -64,6 +65,9 @@ if (! getopts($optlist, \%options)) {
if
(
defined
(
$options
{"
d
"}))
{
if
(
defined
(
$options
{"
d
"}))
{
$debug
++
;
$debug
++
;
}
}
if
(
defined
(
$options
{"
n
"}))
{
$impotent
=
1
;
}
# Load the Testbed support stuff.
# Load the Testbed support stuff.
use
lib
"
@prefix
@/lib
";
use
lib
"
@prefix
@/lib
";
...
@@ -152,7 +156,11 @@ if ($elabman->FlipTo($experiment->unix_gid())) {
...
@@ -152,7 +156,11 @@ if ($elabman->FlipTo($experiment->unix_gid())) {
#
#
sub
handler
()
sub
handler
()
{
{
my
$SAVEEUID
=
$EUID
;
$EUID
=
0
;
ReOpenLog
(
$LOGFILE
);
ReOpenLog
(
$LOGFILE
);
$EUID
=
$SAVEEUID
;
}
}
$SIG
{
HUP
}
=
\
&handler
$SIG
{
HUP
}
=
\
&handler
if
(
!
$debug
);
if
(
!
$debug
);
...
@@ -183,6 +191,9 @@ while (1) {
...
@@ -183,6 +191,9 @@ while (1) {
while
(
my
(
$nodeid
,
$eventstate
,
$stamp
)
=
$query_result
->
fetchrow_array
())
{
while
(
my
(
$nodeid
,
$eventstate
,
$stamp
)
=
$query_result
->
fetchrow_array
())
{
print
"
Node in unknown state:
$nodeid
,
$eventstate
,
$stamp
\n
";
print
"
Node in unknown state:
$nodeid
,
$eventstate
,
$stamp
\n
";
next
if
(
$impotent
);
my
$node
=
Node
->
Lookup
(
$nodeid
);
my
$node
=
Node
->
Lookup
(
$nodeid
);
if
(
!
defined
(
$node
))
{
if
(
!
defined
(
$node
))
{
...
@@ -209,6 +220,11 @@ while (1) {
...
@@ -209,6 +220,11 @@ while (1) {
goto
loop
goto
loop
if
(
!
@nodelist
);
if
(
!
@nodelist
);
if
(
$impotent
)
{
print
"
Would check
@nodelist
\n
";
goto
loop
;
}
foreach
my
$node
(
@nodelist
)
{
foreach
my
$node
(
@nodelist
)
{
if
(
$node
->
ClearBootAttributes
())
{
if
(
$node
->
ClearBootAttributes
())
{
print
STDERR
"
$node
: Could not clear boot attributes.
\n
";
print
STDERR
"
$node
: Could not clear boot attributes.
\n
";
...
@@ -309,7 +325,7 @@ while (1) {
...
@@ -309,7 +325,7 @@ while (1) {
next
;
next
;
}
}
loop:
loop:
sleep
(
60
);
sleep
(
(
$debug
?
10
:
60
)
)
;
}
}
exit
(
0
);
exit
(
0
);
...
...
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