summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2009-08-24 19:44:07 +0000
committerBadlop <badlop@process-one.net>2009-08-24 19:44:07 +0000
commit73282e0760afe6aa4303e8dedcb8111dfa1e7b1c (patch)
tree39fe04ca4726fdb0083dacc2222f86a31ceb419e /src
parentAdded preliminary template file for ejabberd.init (thanks to Christophe Romain) (diff)
Prepare ejabberd.init when installing ejabberd.
SVN Revision: 2521
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in7
-rw-r--r--src/ejabberd.init.template8
2 files changed, 11 insertions, 4 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 9c3121ce..bc8e8ef5 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -21,11 +21,13 @@ ifeq ($(INSTALLUSER),)
G_USER=
CHOWN_COMMAND=echo
CHOWN_OUTPUT=/dev/null
+ INIT_USER=root
else
O_USER=-o $(INSTALLUSER)
G_USER=-g $(INSTALLUSER)
CHOWN_COMMAND=chown
CHOWN_OUTPUT=&1
+ INIT_USER=$(INSTALLUSER)
endif
EFLAGS += @ERLANG_SSL39@ -pa .
@@ -186,6 +188,11 @@ install: all
[ -d $(SBINDIR) ] || install -d -m 755 $(SBINDIR)
install -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
#
+ # Init script
+ sed -e "s*@ctlscriptpath@*$(SBINDIR)*" \
+ -e "s*@installuser@*$(INIT_USER)*" ejabberd.init.template \
+ > ejabberd.init
+ #
# Binary Erlang files
install -d $(BEAMDIR)
install -m 644 *.app $(BEAMDIR)
diff --git a/src/ejabberd.init.template b/src/ejabberd.init.template
index 948e5c4d..6659557b 100644
--- a/src/ejabberd.init.template
+++ b/src/ejabberd.init.template
@@ -2,11 +2,11 @@
set -o errexit
set -o nounset
-DIR=@@INSTALLDIR@@
-CTL="$DIR"/bin/ejabberdctl
-USER=ejabberd
+DIR=@ctlscriptpath@
+CTL="$DIR"/ejabberdctl
+USER=@installuser@
-test -d "$DIR" || {
+test -x "$CTL" || {
echo "ERROR: ejabberd not found: $DIR"
exit 1
}