summaryrefslogtreecommitdiff
blob: 0fb1f5ce602ec7ce062ba55c46428a627dfac08d (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
Subject: [PATCH] Adjust ejabberdctl for Gentoo jabberbase setup

Set SHELL since the generic jabber user used on Gentoo for jabber
servers doesn't have a valid shell set by default and fix EXEC_CMD
otherwise it fails with This account is currently not available again
due to jabber not having a valid shell.

Also, workaround the assumption that jabber's /root is a directory when
instead it defaults to /dev/null on Gentoo.
---

diff --git a/ejabberdctl.template b/ejabberdctl.template
index 571b90b..71336c0 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -82,6 +82,7 @@ fi
 ERL_LIBS={{libdir}}
 ERL_CRASH_DUMP="$LOGS_DIR"/erl_crash_$(date "+%Y%m%d-%H%M%S").dump
 ERL_INETRC="$ETC_DIR"/inetrc
+HOME=$SPOOL_DIR
 
 # define ejabberd parameters
 EJABBERD_OPTS="$EJABBERD_OPTS\
@@ -105,12 +106,13 @@ export ERL_MAX_ETS_TABLES
 export CONTRIB_MODULES_PATH
 export CONTRIB_MODULES_CONF_DIR
 export ERL_LIBS
+export HOME
 
 # run command either directly or via su $INSTALLUSER
 exec_cmd()
 {
     case $EXEC_CMD in
-        as_install_user) su -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
+        as_install_user) su -p -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
         as_current_user) "$@" ;;
     esac
 }