summaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2010-05-28 10:52:20 +0000
committerPeter Volkov <pva@gentoo.org>2010-05-28 10:52:20 +0000
commitaea148e189256421af37607fcbe6d94231d12eec (patch)
treed7d0521f7d50e3fa5e9e47a3604c9c811a3e5e10 /net-im
parentVersion bump for oFono to 0.21 (diff)
downloadgentoo-2-aea148e189256421af37607fcbe6d94231d12eec.tar.gz
gentoo-2-aea148e189256421af37607fcbe6d94231d12eec.tar.bz2
gentoo-2-aea148e189256421af37607fcbe6d94231d12eec.zip
Make init script a bit more resistant, e.g. restart should now work, thank Rion for report.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'net-im')
-rw-r--r--net-im/ejabberd/ChangeLog6
-rw-r--r--net-im/ejabberd/files/ejabberd-3.initd30
2 files changed, 32 insertions, 4 deletions
diff --git a/net-im/ejabberd/ChangeLog b/net-im/ejabberd/ChangeLog
index 408b6de3244d..e86d6946b765 100644
--- a/net-im/ejabberd/ChangeLog
+++ b/net-im/ejabberd/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-im/ejabberd
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.71 2010/05/27 07:31:43 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.72 2010/05/28 10:52:20 pva Exp $
+
+ 28 May 2010; Peter Volkov <pva@gentoo.org> files/ejabberd-3.initd:
+ Make init script a bit more resistant, e.g. restart should now work, thank
+ Rion for report.
27 May 2010; Peter Volkov <pva@gentoo.org> ejabberd-2.1.3.ebuild:
Fixed future build problem reproducible with -rX, where X!=0, thank Rion
diff --git a/net-im/ejabberd/files/ejabberd-3.initd b/net-im/ejabberd/files/ejabberd-3.initd
index 857af1d653e4..9fa5709c0695 100644
--- a/net-im/ejabberd/files/ejabberd-3.initd
+++ b/net-im/ejabberd/files/ejabberd-3.initd
@@ -1,7 +1,7 @@
#!/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.1 2010/05/26 20:25:25 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd,v 1.2 2010/05/28 10:52:20 pva Exp $
depend() {
use dns
@@ -10,13 +10,37 @@ depend() {
}
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() {
+ if ejabberdctl status >/dev/null 2>&1 || test $? = 3; then
+ ewarn "ejabberd is already stopped (manually?)."
+ return 0
+ fi
ebegin "Stopping ejabberd"
- /usr/sbin/ejabberdctl stop
- eend $?
+ 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
}