On 10/13/2014 11:48 PM, Philipp Huebner wrote:

> https://github.com/processone/ejabberd/blob/14.07/ejabberd.init.template

> This template gets patched, then populated at build time and finally
> installed into the Debian package.

Looks like the patching isn't completed, as log_*_msg isn't used.
Moreover it's enough to "test -x "$CTL" || exit 0" once at the
beginning.


> Sound's good to me!

Nice! See attachment.


# /etc/init.d/ejabberd reload 
Warning: reload action is not avaliable!
You need to install ejabberd-contrib package,
add 'mod_admin_extra: {}' to the modules section in /etc/ejabberd/ejabberd.yml,
and restart the server.

# /etc/init.d/ejabberd stop
Stopping ejabberd...
done.

# enabling mod_admin_extra

# /etc/init.d/ejabberd reload
not running.

# /etc/init.d/ejabberd start
Starting ejabberd...
done.

# /etc/init.d/ejabberd reload 
Reloading jabberd...
done.


-- 
sergio.
--- ejabberd.dpkg-dist	2014-10-14 17:21:14.694699661 +0400
+++ ejabberd	2014-10-14 17:20:07.098736479 +0400
@@ -22,6 +22,7 @@
 CTL="$DIR"/ejabberdctl
 USER=ejabberd
 EJABBERDRUN=/var/run/ejabberd
+CONFIG=/etc/ejabberd/ejabberd.yml
 
 test -x "$CTL" || {
 	echo "ERROR: ejabberd not found: $DIR"
@@ -69,12 +70,29 @@
     echo "Getting ejabberd status..."
     su - $USER -c "$CTL status"
     ;;
+  reload)
+    test -x "$CTL" || exit 0
+    $CTL status >/dev/null || {
+      echo "not running."
+      exit 0
+    }
+    $CTL help load_config | grep -q 'Command Name: load_config' || {
+      echo "Warning: reload action is not avaliable!"
+      echo "You need to install ejabberd-contrib package,"
+      echo "add 'mod_admin_extra: {}' to the modules section in $CONFIG,"
+      echo "and restart the server."
+      exit 0
+    }
+    echo "Reloading jabberd..."
+    su - $USER -c "$CTL load_config $CONFIG"
+    echo "done."
+    ;;
   force-reload|restart)
     "$0" stop
     "$0" start
     ;;
   *)
-    echo "Usage: $0 {start|stop|restart|force-reload|status}"
+    echo "Usage: $0 {start|stop|reload|restart|force-reload|status}"
     exit 1
 esac

Reply via email to