| @@ -1,45 +1,56 @@ | | | @@ -1,45 +1,56 @@ |
1 | $NetBSD: patch-ae,v 1.8 2014/07/30 09:45:38 fhajny Exp $ | | 1 | $NetBSD: patch-ae,v 1.9 2014/08/21 19:32:27 tron Exp $ |
2 | | | 2 | |
3 | Default locations. | | 3 | - Default locations. |
4 | --- ejabberdctl.template.orig 2014-07-22 15:42:49.000000000 +0000 | | 4 | - Make it work with NetBSD's flock(1). |
5 | +++ ejabberdctl.template | | 5 | |
6 | @@ -22,7 +22,7 @@ if [ "$INSTALLUSER" != "" ] ; then | | 6 | --- ejabberdctl.template.orig 2014-07-22 16:42:49.000000000 +0100 |
| | | 7 | +++ ejabberdctl.template 2014-08-21 20:17:35.000000000 +0100 |
| | | 8 | @@ -22,7 +22,7 @@ |
7 | EXEC_CMD="false" | | 9 | EXEC_CMD="false" |
8 | for GID in `id -G`; do | | 10 | for GID in `id -G`; do |
9 | if [ $GID -eq 0 ] ; then | | 11 | if [ $GID -eq 0 ] ; then |
10 | - EXEC_CMD="su $INSTALLUSER -p -c" | | 12 | - EXEC_CMD="su $INSTALLUSER -p -c" |
11 | + EXEC_CMD="su $INSTALLUSER -m -c" | | 13 | + EXEC_CMD="su $INSTALLUSER -m -c" |
12 | fi | | 14 | fi |
13 | done | | 15 | done |
14 | if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then | | 16 | if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then |
15 | @@ -67,10 +67,10 @@ if [ "$EJABBERD_CONFIG_PATH" = "" ] ; th | | 17 | @@ -67,10 +67,10 @@ |
16 | EJABBERD_CONFIG_PATH=$ETC_DIR/ejabberd.yml | | 18 | EJABBERD_CONFIG_PATH=$ETC_DIR/ejabberd.yml |
17 | fi | | 19 | fi |
18 | if [ "$LOGS_DIR" = "" ] ; then | | 20 | if [ "$LOGS_DIR" = "" ] ; then |
19 | - LOGS_DIR={{localstatedir}}/log/ejabberd | | 21 | - LOGS_DIR={{localstatedir}}/log/ejabberd |
20 | + LOGS_DIR=@EJABBERD_LOGDIR@ | | 22 | + LOGS_DIR=@EJABBERD_LOGDIR@ |
21 | fi | | 23 | fi |
22 | if [ "$SPOOL_DIR" = "" ] ; then | | 24 | if [ "$SPOOL_DIR" = "" ] ; then |
23 | - SPOOL_DIR={{localstatedir}}/lib/ejabberd | | 25 | - SPOOL_DIR={{localstatedir}}/lib/ejabberd |
24 | + SPOOL_DIR=@EJABBERD_DB@ | | 26 | + SPOOL_DIR=@EJABBERD_DB@ |
25 | fi | | 27 | fi |
26 | if [ "$EJABBERD_DOC_PATH" = "" ] ; then | | 28 | if [ "$EJABBERD_DOC_PATH" = "" ] ; then |
27 | EJABBERD_DOC_PATH={{docdir}} | | 29 | EJABBERD_DOC_PATH={{docdir}} |
28 | @@ -81,7 +81,7 @@ if [ "$ERLANG_NODE_ARG" != "" ] ; then | | 30 | @@ -81,7 +81,7 @@ |
29 | fi | | 31 | fi |
30 | if [ "{{release}}" != "true" ] ; then | | 32 | if [ "{{release}}" != "true" ] ; then |
31 | if [ "$EJABBERDDIR" = "" ] ; then | | 33 | if [ "$EJABBERDDIR" = "" ] ; then |
32 | - EJABBERDDIR={{libdir}}/ejabberd | | 34 | - EJABBERDDIR={{libdir}}/ejabberd |
33 | + EJABBERDDIR={{libdir}}/erlang/lib/@DISTNAME@ | | 35 | + EJABBERDDIR={{libdir}}/erlang/lib/@DISTNAME@ |
34 | fi | | 36 | fi |
35 | if [ "$EJABBERD_EBIN_PATH" = "" ] ; then | | 37 | if [ "$EJABBERD_EBIN_PATH" = "" ] ; then |
36 | EJABBERD_EBIN_PATH=$EJABBERDDIR/ebin | | 38 | EJABBERD_EBIN_PATH=$EJABBERDDIR/ebin |
37 | @@ -281,7 +281,7 @@ ctl() | | 39 | @@ -281,7 +281,7 @@ |
38 | # using flock if available. Expects a linux-style | | 40 | # using flock if available. Expects a linux-style |
39 | # flock that can lock a file descriptor. | | 41 | # flock that can lock a file descriptor. |
40 | MAXCONNID=100 | | 42 | MAXCONNID=100 |
41 | - CONNLOCKDIR={{localstatedir}}/lock/ejabberdctl | | 43 | - CONNLOCKDIR={{localstatedir}}/lock/ejabberdctl |
42 | + CONNLOCKDIR=@EJABBERD_PIDDIR@ | | 44 | + CONNLOCKDIR=@EJABBERD_PIDDIR@ |
43 | FLOCK='/usr/bin/flock' | | 45 | FLOCK='/usr/bin/flock' |
44 | if [ ! -x "$FLOCK" ] || [ ! -d "$CONNLOCKDIR" ] ; then | | 46 | if [ ! -x "$FLOCK" ] || [ ! -d "$CONNLOCKDIR" ] ; then |
45 | JOT='/usr/bin/jot' | | 47 | JOT='/usr/bin/jot' |
| | | 48 | @@ -308,7 +308,7 @@ |
| | | 49 | CTL_LOCKFILE="$CONNLOCKDIR/$CTL_CONN" |
| | | 50 | ( |
| | | 51 | exec 8>"$CTL_LOCKFILE" |
| | | 52 | - if flock --nb 8; then |
| | | 53 | + if flock -x -n 8; then |
| | | 54 | ctlexec $CTL_CONN $COMMAND |
| | | 55 | ssresult=$? |
| | | 56 | # segregate from possible flock exit(1) |