Commit fb247a24 authored by Leigh B Stoller's avatar Leigh B Stoller

Install the event perl modules on subboss. Add MarkDaemon ultilties

from boss libtestbed,pm into clientside version of same file.
parent 110ef79f
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -43,7 +43,7 @@ control-install: control-install-subdirs
fs-install: fs-install-subdirs
client-install: client-install-subdirs
subboss: client
subboss-install: client-install
subboss-install: subboss-install-subdirs
clean: clean-subdirs
distclean: distclean-subdirs
mfs frisbee-mfs newnode-mfs:
......
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -179,6 +179,7 @@ fs-install:
client: $(LIBS)
client-install: client # client-libinstall
client-libinstall: client-pylibinstall client-pllibinstall
subboss-install: client client-libinstall
#
# XXX Fix the python install location.
......
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2012, 2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -32,6 +32,7 @@ all: libtb.a
client: libtb-nodb.a
cmp -s libtb-nodb.a libtb.a || cp -pf libtb-nodb.a libtb.a
client-install: client
subboss-install: client
# The point of this is to make sure a nodb version of the library is
# built during the ops-install target when installing a new emulab.
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -37,6 +37,7 @@ use Exporter;
TBSCRIPTLOCK_WOULDBLOCK TBSCRIPTLOCK_INTERRUPTED
TBSCRIPTLOCK_INTERRUPTIBLE
TBTimeStamp TBTimeStampWithDate TBBackGround ReOpenLog
CheckDaemonRunning MarkDaemonRunning MarkDaemonStopped);
);
# Must come after package declaration!
......@@ -465,5 +466,54 @@ sub TBScriptUnlock(;$)
}
}
#
# Check for the existence of a pid file and see if that file is
# running. Mostly cause of devel tree versions.
#
sub CheckDaemonRunning($)
{
my ($name) = @_;
my $pidfile = "/var/run/${name}.pid";
if (-e $pidfile) {
my $opid = `cat $pidfile`;
if ($opid =~ /^(\d*)$/) {
$opid = $1;
}
else {
print STDERR "$pidfile exists, but $opid is malformed\n";
return 1;
}
if (kill(0, $opid)) {
print STDERR "$pidfile exists, and process $opid is running\n";
return 1;
}
unlink($pidfile);
}
return 0;
}
#
# Mark a daemon as running.
#
sub MarkDaemonRunning($)
{
my ($name) = @_;
my $pidfile = "/var/run/${name}.pid";
if (system("echo '$PID' > $pidfile")) {
print STDERR "Could not create $pidfile\n";
return -1;
}
return 0;
}
sub MarkDaemonStopped($)
{
my ($name) = @_;
my $pidfile = "/var/run/${name}.pid";
unlink($pidfile);
return 0;
}
1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment