]> granicus.if.org Git - ejabberd/commitdiff
Prepare ejabberd.init when installing ejabberd.
authorBadlop <badlop@process-one.net>
Mon, 24 Aug 2009 19:44:07 +0000 (19:44 +0000)
committerBadlop <badlop@process-one.net>
Mon, 24 Aug 2009 19:44:07 +0000 (19:44 +0000)
SVN Revision: 2521

src/Makefile.in
src/ejabberd.init.template

index 9c3121cee56a92962a5f1c52379a94ce7bf8e2f1..bc8e8ef554a0a8e99e2b10e8a784c9da37c4b270 100644 (file)
@@ -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)
index 948e5c4d05c2d6fb52a2e263e6f8f27b1cb5ab36..6659557b60efac163e9ef1536dd506acc6807e91 100644 (file)
@@ -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
 }