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.
This commit is contained in:
Johan Oudinet 2015-09-22 17:07:39 +02:00
parent 3300c8d994
commit c360326cdb
3 changed files with 4 additions and 4 deletions

View File

@ -444,11 +444,11 @@ check_start()
# cluster setup # cluster setup
join_cluster() join_cluster()
{ {
$EJABBERD_BIN_PATH/joincluster $* $EXEC_CMD "$EJABBERD_BIN_PATH/joincluster $*"
} }
leave_cluster() leave_cluster()
{ {
$EJABBERD_BIN_PATH/leavecluster $* $EXEC_CMD "$EJABBERD_BIN_PATH/leavecluster $*"
} }
# allow sync calls # allow sync calls

View File

@ -145,7 +145,7 @@ start() ->
EOF EOF
$ERLC -o $PA $CLUSTERSETUP_ERL $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 - cd -
rm -Rf $PA rm -Rf $PA

View File

@ -101,7 +101,7 @@ start() ->
EOF EOF
$ERLC -o $PA $CLUSTERSETUP_ERL $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 - cd -
rm -Rf $PA rm -Rf $PA