openbsd-ports/net/ejabberd/patches/patch-src_ejabberdctl_template
2010-09-13 17:17:06 +00:00

84 lines
2.5 KiB
Plaintext

$OpenBSD: patch-src_ejabberdctl_template,v 1.4 2010/09/13 17:17:06 sebastia Exp $
--- src/ejabberdctl.template.orig Mon Aug 2 18:33:20 2010
+++ src/ejabberdctl.template Wed Aug 18 00:30:24 2010
@@ -1,7 +1,7 @@
#!/bin/sh
# define default configuration
-POLL=true
+POLL=false
SMP=auto
ERL_MAX_PORTS=32000
ERL_PROCESSES=250000
@@ -9,10 +9,10 @@ ERL_MAX_ETS_TABLES=1400
# define default environment variables
NODE=ejabberd
-HOST=localhost
+HOST=`hostname -s`
ERLANG_NODE=$NODE@$HOST
ERL=@erl@
-INSTALLUSER=@installuser@
+INSTALLUSER=${JABBERDUSER}
# parse command line parameters
ARGS=
@@ -33,7 +33,7 @@ done
# Define ejabberd variable if they have not been defined from the command line
if [ "$ETCDIR" = "" ] ; then
- ETCDIR=@SYSCONFDIR@/ejabberd
+ ETCDIR=${SYSCONFDIR}/ejabberd
fi
if [ "$EJABBERD_CONFIG_PATH" = "" ] ; then
EJABBERD_CONFIG_PATH=$ETCDIR/ejabberd.cfg
@@ -43,10 +43,10 @@ if [ "$EJABBERDCTL_CONFIG_PATH" = "" ] ; then
fi
[ -f "$EJABBERDCTL_CONFIG_PATH" ] && . "$EJABBERDCTL_CONFIG_PATH"
if [ "$LOGS_DIR" = "" ] ; then
- LOGS_DIR=@LOCALSTATEDIR@/log/ejabberd
+ LOGS_DIR=${EJLOGDIR}
fi
if [ "$SPOOLDIR" = "" ] ; then
- SPOOLDIR=@LOCALSTATEDIR@/lib/ejabberd
+ SPOOLDIR=${EJDBDIR}/${NODE}
fi
if [ "$EJABBERD_DOC_PATH" = "" ] ; then
EJABBERD_DOC_PATH=@DOCDIR@
@@ -62,7 +62,7 @@ EJID=`id -g $INSTALLUSER`
EXEC_CMD="false"
for GID in $GIDS; do
if [ $GID -eq 0 ] ; then
- EXEC_CMD="su ${INSTALLUSER} -p -c"
+ EXEC_CMD="su ${INSTALLUSER} -m -c"
fi
done
if [ "$ID" -eq "$EJID" ] ; then
@@ -86,7 +86,7 @@ ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES $ERL
# define additional environment variables
if [ "$EJABBERDDIR" = "" ]; then
- EJABBERDDIR=@LIBDIR@/ejabberd
+ EJABBERDDIR=${LOCALBASE}/lib/ejabberd
fi
if [ "$EJABBERD_EBIN_PATH" = "" ]; then
EJABBERD_EBIN_PATH=$EJABBERDDIR/ebin
@@ -112,7 +112,7 @@ ERL_INETRC=$ETCDIR/inetrc
HOME=$SPOOLDIR
# create the home dir with the proper user if doesn't exist, because it stores cookie file
-[ -d $HOME ] || $EXEC_CMD "mkdir -p $HOME"
+#[ -d $HOME ] || $EXEC_CMD "mkdir -p $HOME"
# export global variables
export EJABBERD_CONFIG_PATH
@@ -237,7 +237,7 @@ ctl ()
# using flock if available. Expects a linux-style
# flock that can lock a file descriptor.
MAXCONNID=100
- CONNLOCKDIR=@LOCALSTATEDIR@/lock/ejabberdctl
+ CONNLOCKDIR=/tmp
FLOCK='/usr/bin/flock'
if [ ! -x "$FLOCK" ] || [ ! -d "$CONNLOCKDIR" ] ; then
JOT='/usr/bin/jot'