Refactor: daemons: Break out one of the branches in find_and_track_existing_processes
Simplifying this function is going to take several steps. The first one
is splitting the various cases in the highly nested case statement out
into smaller functions.