]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_ctl.erl: If ejabberd didn't start correctly:
authorBadlop <badlop@process-one.net>
Fri, 24 Oct 2008 22:11:42 +0000 (22:11 +0000)
committerBadlop <badlop@process-one.net>
Fri, 24 Oct 2008 22:11:42 +0000 (22:11 +0000)
'ejabberdctl status' suggests to look in log files; any other
ejabberdctl command shows 'status'.

SVN Revision: 1668

ChangeLog
src/ejabberd_ctl.erl

index c1f0a4d92b8d4100fa358ab83999e1182107c999..f5e2a385359a28230edfa6300b52e9237267b71f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-10-25  Badlop  <badlop@process-one.net>
 
+       * src/ejabberd_ctl.erl: If ejabberd didn't start correctly:
+       'ejabberdctl status' suggests to look in log files; any other
+       ejabberdctl command shows 'status'.
+
        * src/ejabberd_app.erl: Open ejabberd.log sooner, so errors during
        ejabberd initialization are logged in that file (EJAB-777). Write
        a log message when ejabberd finishes the start or stop.
@@ -11,7 +15,7 @@
        * src/mod_roster_odbc.erl: Likewise
        * src/mod_shared_roster.erl: Likewise
 
-       * src/ejabberd_lstener.erl: Fix listeners
+       * src/ejabberd_listener.erl: Fix listeners
        * src/ejabberd_sup.erl: Likewise
        * src/gen_mod.erl: Likewise
 
index 362d12c91e0b1c4a5fbc3f72a8a785fa4c73e369..3289741893bb4565eff2bfc456d68017dae63bec 100644 (file)
@@ -132,7 +132,10 @@ process(["status"]) ->
           [node(), InternalStatus, ProvidedStatus]),
     case lists:keysearch(ejabberd, 1, application:which_applications()) of
         false ->
-            ?PRINT("ejabberd is not running in that node~n", []),
+            EjabberdLogPath = ejabberd_app:get_log_path(),
+            ?PRINT("ejabberd is not running in that node~n"
+                  "Check for error messages: ~s~n"
+                  "or other files in that directory.~n", [EjabberdLogPath]),
             ?STATUS_ERROR;
         {value, {_, _, Version}} ->
             ?PRINT("ejabberd ~s is running in that node~n", [Version]),
@@ -237,7 +240,12 @@ try_run_ctp(Args) ->
     catch
        exit:Why ->
            print_usage(),
-           {io_lib:format("Error in ejabberd ctl process: ~p", [Why]), ?STATUS_USAGE}
+           {io_lib:format("Error in ejabberd ctl process: ~p", [Why]), ?STATUS_USAGE};
+       Error:Why ->
+            %% In this case probably ejabberd is not started, so let's show Status
+            process(["status"]),
+            ?PRINT("~n", []),
+           {io_lib:format("Error in ejabberd ctl process: '~p' ~p", [Error, Why]), ?STATUS_USAGE}
     end.
 
 %% @spec (Args::[string()]) ->