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
5ce7a159
Commit
5ce7a159
authored
Jul 06, 2005
by
Mike Hibler
Browse files
Run the controller status fetches in a child process so we can timeout.
parent
51ea27cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
sensors/powermon/powermon.in
View file @
5ce7a159
...
...
@@ -134,7 +134,25 @@ sub dostatus(@) {
#
# Loop through desired controllers getting status
# We do this in a child process so we can time it out if
# one of the controllers is not responding.
#
my
$syspid
=
fork
();
if
(
$syspid
)
{
#
# Allow 5 seconds per controller
#
local
$SIG
{
ALRM
}
=
sub
{
kill
("
TERM
",
$syspid
);
};
my
$to
=
5
*
scalar
(
@wanted
);
alarm
$to
;
waitpid
(
$syspid
,
0
);
alarm
0
;
if
(
$?
)
{
logit
("
*** Status fetch failed after
$to
seconds with exit val $?
");
}
return
$?
;
}
for
my
$ctrl
(
@wanted
)
{
my
%status
;
...
...
@@ -169,7 +187,7 @@ sub dostatus(@) {
$errors
++
;
}
}
return
$errors
;
exit
(
$errors
)
;
}
sub
logit
($)
{
...
...
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