diff --git a/tmcd/plab/rc.inplab b/tmcd/plab/rc.inplab index e0f377fa74c4a12f290986b4615fc3a716ce04dc..f37c0f0a089d5f1f0f64b07843da920e9b84a2f4 100755 --- a/tmcd/plab/rc.inplab +++ b/tmcd/plab/rc.inplab @@ -32,6 +32,11 @@ if [ -x $BINDIR/watchdog ]; then $BINDIR/watchdog start fi +if [ -x $BINDIR/rusaged ]; then + echo "Starting rusage daemon ..." + $BINDIR/rusaged start +fi + echo "Informing the testbed that we're up and running ..." # XXX Oogly $BINDIR/tmcc -n `cat /var/emulab/boot/plabname` state ISUP diff --git a/tmcd/plab/rusaged b/tmcd/plab/rusaged index 2b66678775e25c5b341efb7ea4c10a54370092c0..4cbf587a4321343c5f797d03a2cd25bc80996b9f 100644 --- a/tmcd/plab/rusaged +++ b/tmcd/plab/rusaged @@ -40,6 +40,7 @@ my $logname = "$LOGDIR/rusaged.debug"; my $pidfile = "/var/run/emulab-rusaged.pid"; my $debug = 0; my $isalivewait = 300; # Seconds to wait. +my $svcslice = "utah_elab_svc"; # # Parse command arguments. Once we return from getopts, all that should be @@ -68,6 +69,13 @@ if ($UID != 0) { " Must be root to run this script!\n"); } +# +# This daemon runs in the service slice only! Sorry for the hardwired name! +# +if (!defined($ENV{'USER'}) || $ENV{'USER'} ne $svcslice) { + exit(0); +} + # # For stop, look to see if the pid file exists. If so, kill it and exit. #