anchor.diff:      process_flag(trap_exit, true),
       ok = net_kernel:monitor_nodes(true,
                                     [{node_type, all}, nodedown_reason]),
  +    ns_mnesia:start(),
       bringup().
   
   %% Bringup services.
  
positive.code: 
  joining({exit, _Pid}, #joining_state{remote=RemoteNode, cookie=NewCookie}) ->
      error_logger:info_msg("ns_cluster: joining cluster. Child has exited.~n"),
      timer:sleep(1000), % Sleep for a second to let things settle
      true = erlang:set_cookie(node(), NewCookie),
      %% Let's verify connectivity.
      Connected = net_kernel:connect_node(RemoteNode),
      error_logger:info_msg("Connection from ~p to ~p:  ~p~n",
                            [node(), RemoteNode, Connected]),
      %% Add ourselves to nodes_wanted on the remote node after shutting
      %% down our own config server.
      MyNode = node(),
      Fun = fun(X) ->
                    lists:usort([MyNode | X])
            end,
      case rpc:call(RemoteNode, ns_config, update_key, [nodes_wanted, Fun]) of
          {badrpc, Crap} -> exit({badrpc, Crap});
          _ -> error_logger:info_msg("Remote config updated to add ~p to ~p~n",
                                     [node(), RemoteNode])
  
negative.code: leaving({exit, _Pid}, LeaveData) ->
      error_logger:info_msg("ns_cluster: leaving cluster~n"),
      timer:sleep(1000),
      ns_mnesia:start(),
      {ok, running, State} = bringup(),
      case LeaveData#leaving_state.callback of
          F when is_function(F) -> F();
  