<commit_before>#!/bin/sh

ARGS=$*

. `dirname $0`/../common-env.sh

#
# cd to the log directory so that any files that get written - cores, gprof
# files, etc. get put in a place where loghole will see them
#
cd $LOGDIR

#
# Start up our own measurement agent
#
echo $SH ${MAGENT_DIR}/run-magent.sh #$ARGS
$SH ${MAGENT_DIR}/run-magent.sh & #$ARGS 
# Kill the agent if we get killed - TODO: harsher kill?
# Because the magent backgrounds itself, it's harder to figure out
# what its pid is, just just do a killall
# Note that we assume that a kill of us is "normal" and just exit 0.
trap "$AS_ROOT killall $MAGENT; exit 0" TERM

#
# Give it time to come up
#
sleep 1

#
# Wait for all of the agents to start
#
echo "Waiting for measurement agents to become ready";
barrier_wait "stub"; _rval=$?
if [ $_rval -ne 0 ]; then
    echo "*** WARNING: not all stubs started ($_rval)"
fi<commit_msg>Fix (I hope) a problem I've been having with the monitor trying to connect to magent before it (magent) is ready. Use the option Jon added to magent to make it daemonize *after* it sets up ports, etc. The changed to auto-magaent.sh should have taken place long ago - I don't know why it didn't.<commit_after>#!/bin/sh

ARGS=$*

. `dirname $0`/../common-env.sh

#
# cd to the log directory so that any files that get written - cores, gprof
# files, etc. get put in a place where loghole will see them
#
cd $LOGDIR

#
# Start up our own measurement agent
#
echo $SH ${MAGENT_DIR}/run-magent.sh #$ARGS
$SH ${MAGENT_DIR}/run-magent.sh --daemonize #$ARGS 
# Kill the agent if we get killed - TODO: harsher kill?
# Because the magent backgrounds itself, it's harder to figure out
# what its pid is, just just do a killall
# Note that we assume that a kill of us is "normal" and just exit 0.
trap "$AS_ROOT killall $MAGENT; exit 0" TERM

#
# Give it time to come up
#
sleep 1

#
# Wait for all of the agents to start
#
echo "Waiting for measurement agents to become ready";
barrier_wait "stub"; _rval=$?
if [ $_rval -ne 0 ]; then
    echo "*** WARNING: not all stubs started ($_rval)"
fi
{'fraction_non_alphanumeric': 0.10294828419526342, 'fraction_numerical': 0.004833252779120348, 'mean_word_length': 3.672686230248307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1524695', 'n_tokens_mistral': 704, 'n_tokens_neox': 684, 'n_words': 325}