From 78a121f6623b972e3021d9ada82c41b303f4ec70 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 21 Aug 2015 08:23:51 +0300 Subject: =?UTF-8?q?=09=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB:=20=20=20=20files/ejabberd-3.confd=20=09=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB:=20=20=20=20files?= =?UTF-8?q?/ejabberd-3.initd=20=09=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB:=20=20=20=20files/ejabberd.logrotate=20=09?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB:=20?= =?UTF-8?q?=20=20=20files/ejabberd.service=20=09=D0=BD=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB:=20=20=20=20files/ejabberd.tm?= =?UTF-8?q?pfiles.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- net-im/ejabberd/files/ejabberd-3.confd | 5 +++ net-im/ejabberd/files/ejabberd-3.initd | 47 ++++++++++++++++++++++++++++ net-im/ejabberd/files/ejabberd.logrotate | 13 ++++++++ net-im/ejabberd/files/ejabberd.service | 17 ++++++++++ net-im/ejabberd/files/ejabberd.tmpfiles.conf | 1 + 5 files changed, 83 insertions(+) create mode 100644 net-im/ejabberd/files/ejabberd-3.confd create mode 100644 net-im/ejabberd/files/ejabberd-3.initd create mode 100644 net-im/ejabberd/files/ejabberd.logrotate create mode 100644 net-im/ejabberd/files/ejabberd.service create mode 100644 net-im/ejabberd/files/ejabberd.tmpfiles.conf (limited to 'net-im') diff --git a/net-im/ejabberd/files/ejabberd-3.confd b/net-im/ejabberd/files/ejabberd-3.confd new file mode 100644 index 0000000..b1e984e --- /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 0000000..29a30da --- /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 0000000..4f32472 --- /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 0000000..0b79256 --- /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 0000000..cf17b73 --- /dev/null +++ b/net-im/ejabberd/files/ejabberd.tmpfiles.conf @@ -0,0 +1 @@ +d /var/lock/ejabberdctl 0750 jabber jabber -- cgit v1.2.3