summaryrefslogtreecommitdiffstats
path: root/testing/ejabberd/ejabberd.initd
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2012-01-26 12:50:48 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2012-01-26 12:51:04 +0000
commitd5b5f59dceb3766dc9601715530d66ab0545f2b2 (patch)
tree651fcdf1eb7ddd2ddf6fd2c6ae00f317f0490341 /testing/ejabberd/ejabberd.initd
parentd4addaa2278f2f7290728179d88f52aa4a3f9ab9 (diff)
downloadaports-d5b5f59dceb3766dc9601715530d66ab0545f2b2.tar.bz2
aports-d5b5f59dceb3766dc9601715530d66ab0545f2b2.tar.xz
testing/ejabberd: initd, confd, install/upgrade triggers, logrotate support added
Diffstat (limited to 'testing/ejabberd/ejabberd.initd')
-rw-r--r--testing/ejabberd/ejabberd.initd47
1 files changed, 47 insertions, 0 deletions
diff --git a/testing/ejabberd/ejabberd.initd b/testing/ejabberd/ejabberd.initd
new file mode 100644
index 000000000..2d6d44d3c
--- /dev/null
+++ b/testing/ejabberd/ejabberd.initd
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd,v 1.3 2010/06/02 07:12:27 pva Exp $
+
+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_OPT} 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
+}