Skip to content
GitLab
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
1aa95140
Commit
1aa95140
authored
May 17, 2010
by
Leigh B Stoller
Browse files
Forgot to switch this over to new pidfile stuff.
parent
9f05de20
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/checknodes_daemon.in
View file @
1aa95140
...
...
@@ -82,16 +82,10 @@ my $NODEILL_PID = NODEILL_PID();
my
$NODEILL_EID
=
NODEILL_EID
();
#
# Check for existing pidfile and running daemon. Mostly cause
# of devel tree versions.
# Only one please.
#
if
(
-
e
$PIDFILE
)
{
my
$opid
=
`
cat
$PIDFILE
`;
chomp
(
$opid
);
if
(
kill
(
0
,
$opid
))
{
fatal
("
Lockfile
$PIDFILE
exists, and process
$opid
is running
");
}
unlink
(
$PIDFILE
);
if
(
CheckDaemonRunning
("
checknodes_daemon
"))
{
fatal
("
Not starting another checknodes daemon!
");
}
#
...
...
@@ -140,10 +134,8 @@ if (! $debug) {
exit
(
0
);
}
}
# This acts as a lockfile to prevent a devel version from running at
# the same time as the real version or another devel version.
if
(
system
("
echo '
$PID
' >
$PIDFILE
"))
{
fatal
("
Could not create
$PIDFILE
!
");
if
(
MarkDaemonRunning
("
checknodes_daemon
"))
{
fatal
("
Could not mark daemon as running!
");
}
print
"
Check Nodes Daemon starting ... pid $$, at
"
.
`
date
`;
...
...
@@ -338,6 +330,7 @@ while (1) {
loop:
sleep
((
$debug
?
10
:
60
));
}
MarkDaemonStopped
("
checknodes_daemon
");
exit
(
0
);
sub
NodeIsDead
($)
...
...
@@ -374,6 +367,8 @@ sub fatal($)
$msg
,
$TBOPS
);
MarkDaemonStopped
("
checknodes_daemon
");
die
("
*** $0:
\n
"
.
"
$msg
\n
");
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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