public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Peter Volkov (pva)" <pva@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in net-im/ejabberd/files: ejabberd-3.initd
Date: Fri, 28 May 2010 10:52:20 +0000 (UTC)	[thread overview]
Message-ID: <20100528105220.92BEA2CE3C@corvid.gentoo.org> (raw)

pva         10/05/28 10:52:20

  Modified:             ejabberd-3.initd
  Log:
  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)

Revision  Changes    Path
1.2                  net-im/ejabberd/files/ejabberd-3.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd?r1=1.1&r2=1.2

Index: ejabberd-3.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ejabberd-3.initd	26 May 2010 20:25:25 -0000	1.1
+++ ejabberd-3.initd	28 May 2010 10:52:20 -0000	1.2
@@ -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 @@
 }
 
 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
 }






             reply	other threads:[~2010-05-28 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28 10:52 Peter Volkov (pva) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-02  7:12 [gentoo-commits] gentoo-x86 commit in net-im/ejabberd/files: ejabberd-3.initd Peter Volkov (pva)
2013-04-05  9:03 Tim Harder (radhermit)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100528105220.92BEA2CE3C@corvid.gentoo.org \
    --to=pva@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox