summaryrefslogtreecommitdiff
path: root/chat/ejabberd/patches/patch-ae
blob: 9eea8eaca58863ce456d5b05a603e7e0daa6c2a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$NetBSD: patch-ae,v 1.12 2015/11/05 12:23:50 fhajny Exp $

- Default locations.
- Make it work with NetBSD's flock(1).

--- ejabberdctl.template.orig	2015-10-28 14:53:12.000000000 +0000
+++ ejabberdctl.template
@@ -72,10 +72,10 @@ if [ "$EJABBERD_CONFIG_PATH" = "" ] ; th
     EJABBERD_CONFIG_PATH=$ETC_DIR/ejabberd.yml
 fi
 if [ "$LOGS_DIR" = "" ] ; then
-    LOGS_DIR={{localstatedir}}/log/ejabberd
+    LOGS_DIR=@EJABBERD_LOGDIR@
 fi
 if [ "$SPOOL_DIR" = "" ] ; then
-    SPOOL_DIR={{localstatedir}}/lib/ejabberd
+    SPOOL_DIR=@EJABBERD_DB@
 fi
 if [ "$EJABBERD_DOC_PATH" = "" ] ; then
     EJABBERD_DOC_PATH={{docdir}}
@@ -86,7 +86,7 @@ if [ "$ERLANG_NODE_ARG" != "" ] ; then
 fi
 if [ "{{release}}" != "true" ] ; then
     if [ "$EJABBERDDIR" = "" ] ; then
-        EJABBERDDIR={{libdir}}/ejabberd
+        EJABBERDDIR={{libdir}}/erlang/lib/ejabberd
     fi
     if [ "$EJABBERD_PRIV_PATH" = "" ] ; then
         EJABBERD_PRIV_PATH=$EJABBERDDIR/priv
@@ -325,7 +325,7 @@ ctl()
     # using flock if available. Expects a linux-style
     # flock that can lock a file descriptor.
     MAXCONNID=100
-    CONNLOCKDIR={{localstatedir}}/lock/ejabberdctl
+    CONNLOCKDIR=@EJABBERD_PIDDIR@
     FLOCK=/usr/bin/flock
     if [ ! -x "$FLOCK" ] || [ ! -d "$CONNLOCKDIR" ] ; then
         JOT=/usr/bin/jot
@@ -352,7 +352,7 @@ ctl()
             CTL_LOCKFILE="$CONNLOCKDIR/$CTL_CONN"
             (
                 exec 8>"$CTL_LOCKFILE"
-                if flock --nb 8; then
+                if flock -x -n 8; then
                     ctlexec $CTL_CONN $COMMAND
                     ssresult=$?
                     # segregate from possible flock exit(1)