1 |
--- src/ejabberdctl.template 2008-05-20 14:22:03.000000000 +0400 |
--- src/ejabberdctl.template.fix_user 2008-08-27 13:37:52.000000000 +0400 |
2 |
+++ src/ejabberdctl.template 2008-06-22 19:41:03.000000000 +0400 |
+++ src/ejabberdctl.template 2008-10-02 09:24:52.000000000 +0400 |
3 |
@@ -9,12 +9,13 @@ |
@@ -9,13 +9,14 @@ |
4 |
|
|
5 |
# define default environment variables |
# define default environment variables |
6 |
NODE=ejabberd |
NODE=ejabberd |
7 |
-HOST=localhost |
-HOST=localhost |
8 |
+HOST=`hostname -s` |
+HOST=`hostname -s` |
9 |
ERLANG_NODE=$NODE@$HOST |
ERLANG_NODE=$NODE@$HOST |
10 |
|
ERL=@erl@ |
11 |
-ROOTDIR=@rootdir@ |
-ROOTDIR=@rootdir@ |
12 |
+ROOTDIR= |
+ROOTDIR= |
13 |
+MAINDIR= |
+MAINDIR= |
18 |
|
|
19 |
# read custom configuration |
# read custom configuration |
20 |
CONFIG=$ROOTDIR/etc/ejabberd/ejabberdctl.cfg |
CONFIG=$ROOTDIR/etc/ejabberd/ejabberdctl.cfg |
21 |
@@ -42,10 +43,10 @@ |
@@ -43,10 +44,10 @@ |
22 |
ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES" |
ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES" |
23 |
|
|
24 |
# define additional environment variables |
# define additional environment variables |
37 |
# common control function |
# common control function |
38 |
ctl () |
ctl () |
39 |
{ |
{ |
40 |
+ /sbin/runuser -s /bin/bash - ejabberd -c " \ |
- $ERL \ |
41 |
erl \ |
+ ERL_COMMAND="$ERL \ |
42 |
$NAME ejabberdctl \ |
$NAME ejabberdctl \ |
43 |
-noinput \ |
-noinput \ |
44 |
-pa $EJABBERD_EBIN \ |
-pa $EJABBERD_EBIN \ |
45 |
- -s ejabberd_ctl -extra $ERLANG_NODE $@ |
- -s ejabberd_ctl -extra $ERLANG_NODE $@ |
46 |
+ -s ejabberd_ctl -extra $ERLANG_NODE $@ \ |
+ -s ejabberd_ctl -extra $ERLANG_NODE $@ \ |
47 |
+ " |
+ " |
48 |
|
+ /sbin/runuser -s /bin/bash - ejabberd -c "$ERL_COMMAND" |
49 |
result=$? |
result=$? |
50 |
case $result in |
case $result in |
51 |
0) :;; |
0) :;; |