Commit c9489e4e authored by Mike Hibler's avatar Mike Hibler

Started out as a small change to put a restart wrapper around opsrecv...

But opsrecv and friends were never officially installed, so took care of
that too (conditional on PELABSUPPORT in the defs file).
parent 2f2d2371
......@@ -2008,7 +2008,9 @@ fi
if test $PELABSUPPORT -eq 0; then
pelabfiles="";
else
pelabfiles="pelab/GNUmakefile pelab/db/GNUmakefile ";
pelabfiles="pelab/GNUmakefile pelab/db/GNUmakefile \
pelab/bgmon/GNUmakefile ";
optional_subdirs="$optional_subdirs pelab";
fi
#
......@@ -2052,17 +2054,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2056: checking for $ac_hdr" >&5
echo "configure:2058: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2061 "configure"
#line 2063 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2101,17 +2103,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2105: checking for $ac_hdr" >&5
echo "configure:2107: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2110 "configure"
#line 2112 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2144,7 +2146,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2148: checking for $ac_word" >&5
echo "configure:2150: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2223,7 +2225,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2227: checking for a BSD compatible install" >&5
echo "configure:2229: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2284,7 +2286,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2288: checking for $ac_word" >&5
echo "configure:2290: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......
......@@ -620,7 +620,9 @@ AC_SUBST(EVENTSYS)
if test $PELABSUPPORT -eq 0; then
pelabfiles="";
else
pelabfiles="pelab/GNUmakefile pelab/db/GNUmakefile ";
pelabfiles="pelab/GNUmakefile pelab/db/GNUmakefile \
pelab/bgmon/GNUmakefile ";
optional_subdirs="$optional_subdirs pelab";
fi
#
......
......@@ -35,12 +35,9 @@ FS_WITH_QUOTAS="/q /users"
WWWHOST=www.emulab.net
TBMAINSITE=1
THISHOMEBASE=Emulab.Net
PLABSUPPORT=1
PLAB_ROOTBALL="plabroot-18.tar.bz2"
MIN_UNIX_UID=10000
MIN_UNIX_GID=6000
WINSUPPORT=1
PELABSUPPORT=1
#
# This next group will not work outside of Utah (yet).
......@@ -54,6 +51,10 @@ CHATSUPPORT=1
NFSTRACESUPPORT=1
ARCHIVESUPPORT=1
OPSDBSUPPORT=1
PELABSUPPORT=1
PLABSUPPORT=1
PLAB_ROOTBALL="plabroot-18.tar.bz2"
#
# SSL Certificate stuff. Used to customize config files in ssl directory.
# Note that OrganizationalUnit is set in the cnf file.
......
......@@ -33,6 +33,7 @@ WWWHOST=changeme
TBMAINSITE=0
THISHOMEBASE=changeme
PLABSUPPORT=0
PELABSUPPORT=0
WIKISUPPORT=changeme
BUGDBSUPPORT=changeme
MAILMANSUPPORT=changeme
......
......@@ -225,6 +225,22 @@ VIRTNODE_NETMASK=255.240.0.0
JAILIPBASE=$VIRTNODE_NETWORK
JAILIPMASK=$VIRTNODE_NETMASK
#
# Only supported on the Mother Ship (emulab.net) right now.
#
WIKISUPPORT=0
BUGDBSUPPORT=0
MAILMANSUPPORT=0
CVSSUPPORT=0
CHATSUPPORT=0
NFSTRACESUPPORT=0
ARCHIVESUPPORT=0
OPSDBSUPPORT=0
SFSSUPPORT=0
PELABSUPPORT=0
PLABSUPPORT=0
PLAB_ROOTBALL="plabroot-18.tar.bz2"
#
# You shouldn't have to change anything below this point
#
......@@ -233,7 +249,6 @@ TBADMINGROUP=tbadmin
TBDBNAME=tbdb
IPBASE=10
DELAYCAPACITY=2
SFSSUPPORT=0
DISABLE_NSE=1
FRISEBEEMCASTADDR="234.5.6"
FRISEBEEMCASTPORT=3564
......@@ -241,4 +256,3 @@ FRISEBEEMCASTPORT=3564
# Sometimes the main page is down in a directory on WWWHOST
# No trailing '/'!
#WWW=www.example.emulab.net/emulab-www
......@@ -237,6 +237,22 @@ VIRTNODE_NETMASK=255.240.0.0
JAILIPBASE=$VIRTNODE_NETWORK
JAILIPMASK=$VIRTNODE_NETMASK
#
# Only supported on the Mother Ship (emulab.net) right now.
#
WIKISUPPORT=0
BUGDBSUPPORT=0
MAILMANSUPPORT=0
CVSSUPPORT=0
CHATSUPPORT=0
NFSTRACESUPPORT=0
ARCHIVESUPPORT=0
OPSDBSUPPORT=0
SFSSUPPORT=0
PELABSUPPORT=0
PLABSUPPORT=0
PLAB_ROOTBALL="plabroot-18.tar.bz2"
#
# You shouldn't have to change anything below this point
#
......@@ -245,7 +261,6 @@ TBADMINGROUP=tbadmin
TBDBNAME=tbdb
IPBASE=10
DELAYCAPACITY=2
SFSSUPPORT=0
DISABLE_NSE=1
FRISEBEEMCASTADDR="234.5.6"
FRISEBEEMCASTPORT=3564
......@@ -253,4 +268,3 @@ FRISEBEEMCASTPORT=3564
# Sometimes the main page is down in a directory on WWWHOST
# No trailing '/'!
#WWW=www.example.emulab.net/emulab-www
......@@ -17,4 +17,17 @@ all: $(BIN_STUFF)
include $(TESTBED_SRCDIR)/GNUmakerules
control-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_STUFF))
install: subdir-install $(addprefix $(INSTALL_DIR)/opsdir/bin/, $(BIN_STUFF))
boss-install: install
subdir-install:
@$(MAKE) -C db boss-install
@$(MAKE) -C bgmon boss-install
clean:
$(INSTALL_DIR)/opsdir/bin/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_DIR)/opsdir/bin
$(INSTALL) $< $@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = pelab/bgmon
USERSBIN_STUFF = opsrecv.pl manager.pl automanagerclient.pl
include $(OBJDIR)/Makeconf
all: $(USERSBIN_STUFF)
include $(TESTBED_SRCDIR)/GNUmakerules
control-install: $(addprefix $(INSTALL_SBINDIR)/, $(USERSBIN_STUFF))
install: $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(USERSBIN_STUFF))
boss-install: install
clean:
$(INSTALL_DIR)/opsdir/sbin/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_DIR)/opsdir/sbin
$(INSTALL) $< $@
......@@ -11,6 +11,7 @@ OBJDIR = ..
SUBDIR = rc.d
WINSUPPORT = @WINSUPPORT@
PELABSUPPORT = @PELABSUPPORT@
SYSTEM := $(shell uname -s)
include $(OBJDIR)/Makeconf
......@@ -30,6 +31,9 @@ else
RC_SCRIPTS += 1.named.sh
endif
endif
ifeq ($(WINSUPPORT),1)
OPS_SCRIPTS += pelab.sh
endif
#
# Force dependencies to make sure configure regenerates if the .in file
......
#!/bin/sh
#
# Utah Network Testbed Flexlab (aka PELAB) startup
#
# XXX config me
PE_PID=tbres
PE_EID=pelabbgmon
BINDIR="@prefix@/sbin"
ETCDIR="@prefix@/etc"
LOGDIR="@prefix@/log/pelab"
opsrecv_args="-e $PE_PID/$PE_EID -d1"
manager_args=""
automanagerclient_args="-l600 0.10"
case "$1" in
start)
if [ -x $BINDIR/opsrecv.pl -a -r $ETCDIR/pelabdb.pwd ]; then
if [ ! -d $LOGDIR ]; then
mkdir -m 755 $LOGDIR
fi
if [ -x $BINDIR/daemon_wrapper ]; then
$BINDIR/daemon_wrapper -n opsrecv -l $LOGDIR/opsrecv.log -- \
$BINDIR/opsrecv.pl $opsrecv_args
$BINDIR/daemon_wrapper -n manager -l $LOGDIR/manager.log -- \
$BINDIR/manager.pl $manager_args
$BINDIR/daemon_wrapper -n automanagerclient -l $LOGDIR/automanagerclient.log -- \
$BINDIR/automanagerclient.pl $automanagerclient_args
else
$BINDIR/opsrecv.pl $opsrecv_args >$LOGDIR/opsrecv.log 2>&1 &
$BINDIR/manager.pl $manager_args >$LOGDIR/manager.log 2>&1 &
$BINDIR/automanagerclient.pl $automanagerclient_args >$LOGDIR/automanagerclient.log 2>&1 &
fi
fi
;;
stop)
if [ -r /var/run/opsrecv_wrapper.pid ]; then
kill `cat /var/run/opsrecv_wrapper.pid`
kill `cat /var/run/manager_wrapper.pid`
kill `cat /var/run/automanagerclient_wrapper.pid`
else
pkill -f "perl.*$BINDIR/daemon_wrapper.*(automanagerclient|manager|opsrecv)\.pl"
fi
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
......@@ -25,7 +25,7 @@ SBIN_SCRIPTS = vlandiff vlansync withadminprivs export_tables cvsupd.pl \
LIBEXEC_SCRIPTS = webcreateimage newnode webdeletenode spewleds webcopy \
websetdest spewsource weblinkmon_ctl webcvsweb \
webspewconlog xlogin webviewvc spewevents
CTRLSBIN_SCRIPTS= opsdb_control.proxy
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper
# These scripts installed setuid, with sudo.
SETUID_BIN_SCRIPTS =
......
......@@ -10,10 +10,10 @@ use POSIX qw(setsid);
sub usage()
{
print "Usage: daemon_wrapper [-i interval] [-p pidfile] [-l logfile] command args ...\n";
print STDERR "Usage: daemon_wrapper [-i interval] [-p pidfile] [-l logfile] [-n name] command args ...\n";
exit(1);
}
my $optlist = "di:p:l:";
my $optlist = "di:p:l:n:";
my $debug = 0;
my $mininterval = 1;
my $maxinterval = (24 * 60 * 60);
......@@ -53,12 +53,25 @@ if (defined($options{"p"})) {
if (defined($options{"l"})) {
$logfile = $options{"l"};
}
if (defined($options{"n"})) {
if ($options{"n"} =~ /^([-\w]+)$/) {
$daemon = $1;
} else {
print STDERR "Bogus characters in name string\n";
exit(1);
}
}
if (@ARGV < 1) {
usage();
}
$cmd = shift;
if ($cmd =~ /.*\/([^\/]+)/) {
$daemon = $1;
if (!defined($daemon)) {
if ($cmd =~ /.*\/([-\w]+)$/) {
$daemon = $1;
} else {
$daemon = "pid$$";
}
}
$cmdargs = join(' ', @ARGV);
......
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