diff options
Diffstat (limited to 'net-im/ejabberd/files')
-rw-r--r-- | net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch | 49 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd-3.confd | 5 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd-3.initd | 47 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd.logrotate | 13 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd.service | 17 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd.tmpfiles.conf | 1 |
6 files changed, 132 insertions, 0 deletions
diff --git a/net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch b/net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch new file mode 100644 index 000000000000..0d2ccf32485f --- /dev/null +++ b/net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch @@ -0,0 +1,49 @@ +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 $HOME is a directory when instead +it defaults to /dev/null on Gentoo. + +--- ejabberd-15.03/ejabberdctl.template ++++ ejabberd-15.03/ejabberdctl.template +@@ -15,6 +15,7 @@ + IEX={{bindir}}/iex + EPMD={{bindir}}/epmd + INSTALLUSER={{installuser}} ++SHELL=/bin/sh + + # Compatibility in ZSH + #setopt shwordsplit 2>/dev/null +@@ -25,11 +26,11 @@ + for GID in `id -G`; do + if [ $GID -eq 0 ] ; then + INSTALLUSER_HOME=$(getent passwd "$INSTALLUSER" | cut -d: -f6) +- if [ -n "$INSTALLUSER_HOME" ] && [ ! -d "$INSTALLUSER_HOME" ] ; then ++ if [ -n "$INSTALLUSER_HOME" ] && [ ! -e "$INSTALLUSER_HOME" ] ; then + mkdir -p "$INSTALLUSER_HOME" + chown "$INSTALLUSER" "$INSTALLUSER_HOME" + fi +- EXEC_CMD="su $INSTALLUSER -c" ++ EXEC_CMD="su $INSTALLUSER -p -c" + fi + done + if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then +@@ -111,6 +112,7 @@ + DATETIME=`date "+%Y%m%d-%H%M%S"` + ERL_CRASH_DUMP=$LOGS_DIR/erl_crash_$DATETIME.dump + ERL_INETRC=$ETC_DIR/inetrc ++HOME=$SPOOL_DIR + + # define erl parameters + ERL_OPTIONS=$(echo $ERL_OPTIONS | sed 's/ /\\ /g') +@@ -167,6 +169,8 @@ + export ERL_INETRC + export ERL_MAX_PORTS + export ERL_MAX_ETS_TABLES ++export HOME ++export SHELL + + # start server + start() diff --git a/net-im/ejabberd/files/ejabberd-3.confd b/net-im/ejabberd/files/ejabberd-3.confd new file mode 100644 index 000000000000..b1e984e4d7ab --- /dev/null +++ b/net-im/ejabberd/files/ejabberd-3.confd @@ -0,0 +1,5 @@ +# Please configure everything at /etc/jabber/ejabberdctl.cfg +# Put here only command line arguments for ejabberdctl (if any are required) + +#EJABBERDCTL_OPTS="" + diff --git a/net-im/ejabberd/files/ejabberd-3.initd b/net-im/ejabberd/files/ejabberd-3.initd new file mode 100644 index 000000000000..29a30da3610d --- /dev/null +++ b/net-im/ejabberd/files/ejabberd-3.initd @@ -0,0 +1,47 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + use dns + need net + provide jabber-server +} + +start() { + if ejabberdctl status >/dev/null 2>&1; then + ewarn "ejabberd is already started (manually?)." + return 0 + fi + ebegin "Starting ejabberd" + /usr/sbin/ejabberdctl ${EJABBERDCTL_OPTS} start + eend $? +} + +stop() { + ejabberdctl status >/dev/null 2>&1 + if test $? = 3; then + ewarn "ejabberd is already stopped (manually?)." + return 0 + fi + ebegin "Stopping ejabberd" + if /usr/sbin/ejabberdctl stop >/dev/null 2>&1; then + cnt=0 + sleep 1 + while ejabberdctl status >/dev/null 2>&1 || test $? = 1; do + echo -n . + cnt=`expr $cnt + 1` + if [ $cnt -ge 60 ] ; then + eend 1 + break + fi + sleep 1 + done + eend 0 + else + eend 1 + einfo "Please, run '/usr/sbin/ejabberdctl stop' to see what's going on." + fi + eend 0 +} diff --git a/net-im/ejabberd/files/ejabberd.logrotate b/net-im/ejabberd/files/ejabberd.logrotate new file mode 100644 index 000000000000..4f324729dba8 --- /dev/null +++ b/net-im/ejabberd/files/ejabberd.logrotate @@ -0,0 +1,13 @@ +/var/log/jabber/*.log { + su jabber jabber + weekly + rotate 4 + missingok + nocreate + sharedscripts + notifempty + compress + postrotate + /usr/sbin/ejabberdctl reopen-log > /dev/null 2>&1 || true + endscript +} diff --git a/net-im/ejabberd/files/ejabberd.service b/net-im/ejabberd/files/ejabberd.service new file mode 100644 index 000000000000..0b792565b75e --- /dev/null +++ b/net-im/ejabberd/files/ejabberd.service @@ -0,0 +1,17 @@ +[Unit] +Description=A distributed, fault-tolerant Jabber/XMPP server +After=network.target + +[Service] +Type=oneshot +User=jabber +LimitNOFILE=16000 +RestartSec=5 +ExecStart=/usr/sbin/ejabberdctl \ + --config /etc/jabber/ejabberd.cfg --ctl-config /etc/jabber/ejabberdctl.cfg \ + --logs "/var/log/jabber" --spool "/var/spool/jabber" start +ExecStop=/usr/sbin/ejabberdctl stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/net-im/ejabberd/files/ejabberd.tmpfiles.conf b/net-im/ejabberd/files/ejabberd.tmpfiles.conf new file mode 100644 index 000000000000..cf17b73b43a3 --- /dev/null +++ b/net-im/ejabberd/files/ejabberd.tmpfiles.conf @@ -0,0 +1 @@ +d /var/lock/ejabberdctl 0750 jabber jabber |