summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/ejabberd/files/ejabberd-1.1.4.initd')
-rw-r--r--net-im/ejabberd/files/ejabberd-1.1.4.initd62
1 files changed, 62 insertions, 0 deletions
diff --git a/net-im/ejabberd/files/ejabberd-1.1.4.initd b/net-im/ejabberd/files/ejabberd-1.1.4.initd
new file mode 100644
index 000000000000..1f37df66a5c4
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-1.1.4.initd
@@ -0,0 +1,62 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ejabberd-1.1.4.initd,v 1.1 2007/09/14 11:38:29 chainsaw Exp $
+
+opts="${opts} reload"
+
+depend() {
+ use dns
+ need net
+ provide jabber-server
+}
+
+checkconfig() {
+ if [ ! -e /etc/jabber/ejabberd.cfg ] ; then
+ eerror "You need an /etc/jabber/ejabberd.cfg file to run ejabberd"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting eJabberd"
+ start-stop-daemon --start --quiet --chuid jabber:jabber \
+ --exec /usr/bin/env HOME=/var/run/jabber /usr/bin/ejabberd -- -noshell -detached
+ eend $?
+ # For bug #190266
+ chown jabber:jabber /var/run/jabber/.erlang.cookie
+}
+
+stop() {
+ ebegin "Stopping eJabberd"
+ if [ -z "$EJABBERD_NODE" ];
+ then
+ EJABBERD_NODE="ejabberd@`hostname -s`"
+ fi
+ /usr/bin/ejabberdctl $EJABBERD_NODE stop
+ eend $?
+}
+
+# Work around a bug in /sbin/runscript.sh - it won't run our custom
+# restart() unless it finds these two strings in the file.
+# svc_start svc_stop
+restart() {
+ ebegin "Restarting eJabberd"
+ if [ -z "$EJABBERD_NODE" ];
+ then
+ EJABBERD_NODE="ejabberd@`hostname -s`"
+ fi
+ /usr/bin/ejabberdctl $EJABBERD_NODE restart
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading eJabberd"
+ if [ -z "$EJABBERD_NODE" ];
+ then
+ EJABBERD_NODE="ejabberd@`hostname -s`"
+ fi
+ /usr/bin/ejabberdctl $EJABBERD_NODE reopen-log
+ eend $?
+}