Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2006 10:49:18 -0000
From:      Shaun Amott <shaun@inerd.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        vsevolod@FreeBSD.org
Subject:   ports/94163: net-im/ejabberd: Fix rc.d script
Message-ID:  <1141728558.1110@charon.picobyte.net>
Resent-Message-ID: <200603071100.k27B0HBa018448@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         94163
>Category:       ports
>Synopsis:       net-im/ejabberd: Fix rc.d script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 07 11:00:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Shaun Amott
>Release:        FreeBSD 5.2.1-RELEASE-p13 i386
>Organization:
>Environment:

FreeBSD 5.2.1-RELEASE-p13 #0: Sun Feb 13 03:06:15 GMT 2005 CUSTOM i386

>Description:

The ejabberd rc script doesn't seem to work. This had me banging my head
against a wall for several hours. There are two problems:

1) The ejabberd binary needs a switch to tell it to start, otherwise
   it spawns one of its many daemons and then sits there doing nothing.

2) The ejabberdctl binary doesn't return accurate information most of
   the time, and thus the rc script fails to stop or start the
   daemon correctly. When it does work, there is always one daemon
   left running. This only vanishes with a kill -9.

Afterthought:

I had a look at the output of "ejabberdctl status"; it is returning a
load of errors:

{error_logger,{{2006,3,7},{10,47,11}},std_error,'File operation error: eacces. Target: ./user_sup.beam. Function: get_file. Process: code_server.'}
{error_logger,{{2006,3,7},{10,47,11}},std_error,'File operation error: eacces. Target: ./supervisor_bridge.beam. Function: get_file. Process: code_server.'}

(etc.)

However, the server otherwise seems to be running fine.

>How-To-Repeat:

Attempt to operate ejabberd using installed rc script.

>Fix:

Patch below.

--- ejabberd.diff begins here ---
--- files/ejabberd.sh.in.orig   Sat Jan  7 06:29:54 2006
+++ files/ejabberd.sh.in        Tue Mar  7 10:25:02 2006
@@ -43,12 +43,7 @@
 ejabberd_start()
 {
     echo -n "Starting $name: "
-    if ejabberd_status; then
-	echo " already running."
-	exit 1
-    else
-	su $EJABBERDUSER -c "$EJABBERD -noshell -detached"
-    fi
+    su $EJABBERDUSER -c "$EJABBERD -s -noshell -detached"
     echo "$name."
 }

@@ -59,8 +54,8 @@
	cnt=0
         while ejabberd_status; do
             cnt=`expr $cnt + 1`
-            if [ $cnt -gt 60 ]; then
-                echo -n " failed "
+            if [ $cnt -gt 6 ]; then
+                killall -u ejabberd -kill
                 break
             fi
             sleep 1
--- ejabberd.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1141728558.1110>