fixup! testbed/arcyd/profile_...: doc simple profiling
Arcyd: BREAK, remove unused plugin manager for now

In preparation for multi-threading, reduce the amount of things that
need to be thread-safe by removing the unused plugin manager for now. We
can re-instate it if we need it later.

Test Plan:
$ ./precommit.sh
Arcyd: BREAK, remove arcyd dev-status-html

Prior to moving to a multi-process model, start removing functionality
that won't fit cleanly into the new model.

Remove the 'dev-status-html' command with the intent to replace it with
something that fits later.

Test Plan:
$ ./precommit.sh
$ git grep -l dev-status-html
Arcyd: BREAK, remove arcyd instaweb

Prior to moving to a multi-process model, start removing functionality
that won't fit cleanly into the new model.

Remove the 'instaweb' command with the intent to replace it with
something that fits later.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    $ exit
$ git grep -l instaweb
Arcyd: BREAK, remove arcyd *-status-html

Prior to moving to a multi-process model, start removing functionality
that won't fit cleanly into the new model.

Remove the 'arcyd-status-html' and 'repo-status-html' commands with the
intent to replace them with something that fits later.

Test Plan:
$ ./precommit.sh
$ git grep -l statushtml
$ git grep -l status-html
$ ./testbed/arcyd/acceptance_tests.sh
Arcyd: refactor, inject mail_sender

Move construction of the mail_sender up and out to where we have access
to the options for arcyd. This so that we're not relying on the
arcyd_reporter to store these options and it can be later removed.

Test Plan:
$ ./precommit.sh
Arcyd: use 'set -u' to catch undefined vars

Make some of the bash scripts a bit safer by enabling the flag to treat
undefined variables as errors.

Add comments to such flags to explain why they are there.

Test Plan:
Exercise the affected scripts
$ ./testbed/arcyd/loop_test.sh
$ ./testbed/arcyd/exercise_arcyd.sh
$ ./testbed/arcyd/test_shell.sh
Arcyd: refactor, extract 'savesystemerror.sh'

Make it easier to read and re-use the savesystemerror code in
test_shell.sh by extracting it to it's own script.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
Arcyd: test_shell.sh, separate output more clearly
Arcyd: refactor, remove unused 'logger' from _loop

Test Plan:
$ ./testbed/arcyd/loop_test.sh
Arcyd: use external error logger in _loop.sh

Make it possible to see external errors that are logged from the
'unreliable git host test' test by hooking up an exernal error logger in
_loop.

Add dividers to the log output.

Test Plan:
Observe logged errors from
$ ./testbed/arcyd/unreliable_git_loop_test.sh
Arcyd: move external logger to abdt_logging

Don't route all calls to the external logger through abdt_arcydreporter
as we'll be removing it. Re-route them through abdt_logging instead for
now.

Test Plan:
$ ./precommit.sh

Make sure that error messages still get through
$ ./testbed/arcyd/unreliable_git_loop_test.sh
Arcyd: test_shell.sh, display git-phab-writes.log

For more info and to make it easy to exercise the --io-log-file option,
display the 'git-phab-writes.log' at the end of test_shell.sh

Test Plan:
View the log
$ ./testbed/arcyd/test_shell.sh
    $ ./poke.sh
    $ exit
Arcyd: remove dep of on_io_event on arcydreporter

Make it possible to remove the arcydreporter by removing the last
critical dependency on it. abdt_logging.on_io_event() will now work
without it.

Test Plan:
$ ./precommit.sh

Check the log is still updated
$ ./testbed/arcyd/test_shell.sh
    $ ./poke.sh
    $ exit
    .. view last lines of output ..
Arcyd: BREAK, remove arcyd and repo reporters

Prior to moving to a multi-process model, start removing functionality
that won't fit cleanly into the new model.

Remove the 'arcydreporter' and 'reporeporter' code paths.

This breaks logging some performance stats via the external reporter
registered with `--external-report-command`.

Test Plan:
$ ./precommit.sh
$ git grep abdt_arcydreporter
$ git grep abdt_reporeporter
Arcyd: refactor, remove unused repooptions

We haven't needed the 'options stored in a ref' functionality for some
time, simplify things by removing it all.

Test Plan:
$ ./precommit.sh
$ git grep repooptions

exercise the multiple admin email path
$ ./testbed/arcyd/test_shell.sh
    $ exit
Arcyd: refactor, inline '_do'

The wrapper function 'do' is now trivial, inline the '_do' function.

Move the implementation detail '_flatten_list' to the bottom of the
file.

Test Plan:
$ ./precommit.sh
abdi_processrepoargs: refactor, fix indentation

Test Plan:
$ ./precommit.sh
Arcyd: add rudimentary multiprocessing

Start to move towards a multiprocessing model by delegating all real
work to a worker process shortly after 'arcyd start'.

Immediately try to join the worker process. Propagate SIGTERM to the
worker process.

Note some of the problems that will need to be addressed before spawning
more workers.

Test Plan:

Try to get general coverage
$ ./precommit.sh
$ ./testbed/arcyd/acceptance_tests.sh

Exercise shutdown paths and inspect logs
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd
    $ arcyd stop
    $ tail var/log/*
    $ arcyd start
    $ arcyd stop --force
    $ tail var/log/*
Arcyd: BREAK, remove 'arcyd stop --force'

Remove the '--force' flag from 'arcyd stop' as it's going to take extra
work to implement for a multithreading environment.

The intention is to make 'arcyd stop' work by sending 'SIGTERM' anyway
and handle that more gracefully.

Update 'test_shell' to use the regular killfile path.

Test Plan:
$ ./precommit.sh

Exercise the changed script
$ ./testbed/arcyd/test_shell.sh
    $ exit