From: Johan Oudinet Date: Tue, 22 Sep 2015 15:07:39 +0000 (+0200) Subject: Allow root to run join_cluster and leave_cluster X-Git-Tag: 15.09~13^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c360326cdbc4797c519d732f29d10506ef10f196;p=ejabberd Allow root to run join_cluster and leave_cluster Prefix the call to joincluster and leavecluster in ejabberdctl by $EXEC_CMD. Avoid using sh -c in these scripts. Should fix #676. --- diff --git a/ejabberdctl.template b/ejabberdctl.template index 4704c85c4..04ede3471 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -444,11 +444,11 @@ check_start() # cluster setup join_cluster() { - $EJABBERD_BIN_PATH/joincluster $* + $EXEC_CMD "$EJABBERD_BIN_PATH/joincluster $*" } leave_cluster() { - $EJABBERD_BIN_PATH/leavecluster $* + $EXEC_CMD "$EJABBERD_BIN_PATH/leavecluster $*" } # allow sync calls diff --git a/tools/joincluster b/tools/joincluster index ff2e0380f..99b96bdb3 100755 --- a/tools/joincluster +++ b/tools/joincluster @@ -145,7 +145,7 @@ start() -> EOF $ERLC -o $PA $CLUSTERSETUP_ERL -sh -c "$ERL $NAME $ERLANG_NODE -pa $PA $KERNEL_OPTS -mnesia extra_db_nodes \"['$REMOTE']\" dir \"\\\"$SPOOL_DIR\\\"\" -s mnesia -s $CLUSTERSETUP start" +$ERL $NAME $ERLANG_NODE -pa $PA $KERNEL_OPTS -mnesia extra_db_nodes "['$REMOTE']" dir "\"$SPOOL_DIR\"" -s mnesia -s $CLUSTERSETUP start cd - rm -Rf $PA diff --git a/tools/leavecluster b/tools/leavecluster index b2dfea0c7..688b6032b 100755 --- a/tools/leavecluster +++ b/tools/leavecluster @@ -101,7 +101,7 @@ start() -> EOF $ERLC -o $PA $CLUSTERSETUP_ERL -sh -c "$ERL $NAME $ERLANG_NODE -pa $PA $KERNEL_OPTS -mnesia dir \"\\\"$SPOOL_DIR\\\"\" -s mnesia -s $CLUSTERSETUP start" +$ERL $NAME $ERLANG_NODE -pa $PA $KERNEL_OPTS -mnesia dir "\"$SPOOL_DIR\"" -s mnesia -s $CLUSTERSETUP start cd - rm -Rf $PA