anchor.diff:      parse_args(Tail, [sasl | Acc]);
   parse_args(["--hup" | Tail], Acc) ->
       parse_args(Tail, [hup | Acc]);
  +parse_args(["--ping" | Tail], Acc) ->
  +    parse_args(Tail, [ping | Acc]);
   parse_args(["--", ConfigFilePath], Acc) ->
       [{config, ConfigFilePath} | Acc];
   parse_args(["-" ++ _ = Option | _Tail], _Acc) ->
  
positive.code:         false ->
              nop
      end,
      %% use non-default TCP port number for Erlang port mapper
      %% to avoid interfere with normal Erlang nodes running on the host.
      true = os:putenv("ERL_EPMD_PORT", "4370"),
      %% bind Erlang port mapper only to loopback network interface
      _IgnoredStdout = os:cmd("epmd -address 127.0.0.1 -daemon"),
      %% parse and process command line arguments
      ParsedArgs = parse_args(Args),
      case proplists:is_defined(sasl, ParsedArgs) of
          true ->
              ok = application:start(sasl, permanent);
          false ->
              nop
      end,
      ConfigFilePath = proplists:get_value(config, ParsedArgs),
      {InstanceID, Cookie} = erjik_config_parser:read_daemon_cfg(ConfigFilePath),
      case proplists:is_defined(hup, ParsedArgs) of
          true ->
              MyID = list_to_atom(atom_to_list(InstanceID) ++ "_hupper"),
              ok = start_net_kernel(MyID, Cookie),
              case net_adm:ping(ErjikNode = node_fullname(InstanceID)) of
                  pong ->
                      ok = rpc:call(ErjikNode, erjik_cfg, hup, []);
                  pang ->
                      err("Erjik is not alive", [])
              end;
          false ->
              ok = start_net_kernel(InstanceID, Cookie),
              ok = application:load(?MODULE),
              ok = application:set_env(?MODULE, ?CFG_ERJIK_CONFIG, ConfigFilePath),
              ok = application:start(?MODULE, permanent),
              timer:sleep(infinity)
      end.
  
  %% --------------------------------------------------------------------
  %% Internal functions
  %% --------------------------------------------------------------------
  
  %% @doc
  -spec start_net_kernel(NodeShortName :: atom(), Cookie :: atom()) ->
  
negative.code:       "  ~s /path/to/config~n"
        "\tStart Erjik;~n"
        "  ~s --hup /path/to/config~n"
        "\tSend reconfig signal to running Erjik instance;~n"
        "  ~s --ping /path/to/config~n"
        "\tCheck if Erjik instance is alive or not.~n",
        [version(), N, N, N, N]),
      halt().
  
  %% @doc Return epv version.
  