Bug 197134 - Init-Script not working properly on ejabberd 1.1.1
Init-Script not working properly on ejabberd 1.1.1
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: ejabberd (Show other bugs)
5
All Linux
medium Severity urgent
: ---
: ---
Assigned To: Jeffrey C. Ollie
Fedora Extras Quality Assurance
http://www.process-one.net/en/project...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-28 14:57 EDT by Grosswiler Roger
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-08 10:03:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Grosswiler Roger 2006-06-28 14:57:05 EDT
Description of problem:

Ejabberd doesn't let itself start via initscript, this indicates "OK" but does
not start ejabberd. The ports for c2s and s2s are not present. The init-script
uses this:

[snip]
 "erl" "-pa /usr/lib/ejabberd-1.1.1/ebin \
                   -sname ejabberd \
                   -s ejabberd \
                   -ejabberd config \\\"/etc/ejabberd/ejabberd.cfg\\\" \
                             log_path \\\"/var/log/ejabberd/ejabberd.log\\\" \
                   -sasl sasl_error_logger
\\{file,\\\"/var/log/ejabberd/sasl.log\\\"\\} \
                   -mnesia dir \\\"/var/lib/ejabberd/spool\\\" \
                   -kernel inetrc \\\"/etc/ejabberd/inetrc\\\" \
                   -detached"
[/snip] -> this is very similar to what they mention how to start the
application on the ejabberd-homepage.

Version-Release number of selected component (if applicable):
ejabberd-1.1.1

How reproducible:
Always - even on other Systems (FreeBSD 6.1) -> see here:
http://ejabberd.jabber.ru/node/894

same issue, same effect.

Steps to Reproduce:
1. install ejabberd
2. configure it
3. /sbin/service ejabberd start
  
Actual results:
root      6778  0,0  0,2  1312   944  ??  S    11:41     0:00,01
/usr/local/lib/erlang/erts-5.5/bin/epmd -daemon
ejabberd  6825  0,0  0,3  2540  1780  ??  Ss   11:47     0:00,03
/usr/local/lib/erlang/lib/ssl-3.0.12/priv/bin/ssl_esock

Expected results:
root      2804     1  0 Jun27 ?        00:00:00
/usr/lib/erlang/erts-5.4.13/bin/epmd -daemon
root      2806     1  0 Jun27 ?        00:00:04
/usr/lib/erlang/erts-5.4.13/bin/beam -- -root /usr/lib/erlang -progname erl
-root      2809  2806  0 Jun27 ?        00:00:00
/usr/lib/erlang/lib/ssl-3.0.11/priv/bin/ssl_esock

--> see line 2 (including the beam-process) - beware, i've been starting it
manually as root from within /etc/ejabberd using this line:
erl -pa /var/lib/ejabberd/ebin -name ejabberd -s ejabberd (according to the
manual, i have a old version in a separate dir)

Additional info:

line 3 is missing starting it with:
erl -pa /usr/lib/ejabberd-1.1.1/ebin -name ejabberd -s ejabberd
Comment 1 Grosswiler Roger 2006-06-28 15:05:40 EDT
those processe have also been started with the older version:

root      2320  2313  0 21:03 ?        00:00:00 inet_gethost 4
root      2321  2320  0 21:03 ?        00:00:00 inet_gethost 4
root      2322  2320  0 21:03 ?        00:00:00 inet_gethost 4

Process 2320 is connected to its parent, which is this line:
root      2316  2313  0 21:03 ?        00:00:00
/usr/lib/erlang/lib/ssl-3.0.11/priv/bin/ssl_esock
Comment 2 Jeffrey C. Ollie 2006-06-28 15:15:49 EDT
The FE ejabberd init script is designed to run ejabberd as the "ejabberd" user.
 If you were installing/running ejabberd manually before and running it as root
you'll probably have to move files around and change ownership to ejabberd/ejabberd.

I also noticed that in the "actual results" section, it's referring to erlang in
/usr/local/lib.  Do you have a manually installed copy of erlang and ejabberd in
/usr/local/lib?  You'll probably want to eliminate the manually installed copies
so that things aren't getting confused.
Comment 3 Grosswiler Roger 2006-06-28 15:30:41 EDT
Erlang installed from repos:
[root@mordor pyicq-t-0.7a]# rpm -q erlang
erlang-R10B-10.2.fc5

ownership is everywhere (inclusive /etc/ejabberd and subcontents) set to
ejabberd:ejabberd

old env (ejabberd 1.1.0 from source) installed completely in /var/lib/ejabberd

so, i don't think its an issue. also, other in forums from ejabberd.jabber.ru on
freebsd have the same effect.
Comment 4 Jeffrey C. Ollie 2006-06-28 16:36:14 EDT
Hmm... you may want to update erlang... the most current version in extras is
R11B-0.1.fc5, and is what ejabberd is compiled against.
Comment 5 Eric Wood 2006-06-28 19:32:54 EDT
ejabberd-1.1.1-8.fc4 didn't install properly because it looks like it wanted a
specific user id and group id of 27.  But that's mysql's user id already:

# rpm -q --scripts ejabberd
preinstall scriptlet (using /bin/sh):
/usr/sbin/fedora-groupadd 27 -r ejabberd &>/dev/null || :
/usr/sbin/fedora-useradd  27 -r -s /sbin/nologin -d /var/lib/ejabberd -M \
                            -c 'ejabberd' -g ejabberd ejabberd &>/dev/null || :

Therefor, ejabberd got installed as root/root permissions.  The init scripts
won't work and who knows what else.  Need a way to ejabberd to use the next free
user/group number.
Comment 6 Jeffrey C. Ollie 2006-06-28 23:06:33 EDT
The fedora-groupadd and fedora-useradd commands do not use '27' as the actual
user/group id.  Here's some info on how these commands actually work:

https://www.redhat.com/archives/fedora-extras-list/2006-March/msg00688.html

Many of the ejabberd files are supposed to be owned by root.  The only files
that are supposed to be owned by ejabberd are configuration and database files.
Comment 7 Grosswiler Roger 2006-06-30 03:12:10 EDT
Okay, i have it all working now:

- ejabberd
- AND its initscripts

2 things to do:

- update Erlang to erlang.i386 R11B-0.1.fc5
- copy the CONTENT of the Mnesia-Database to /var/lib/ejabberd/spool/
- chown the new database to ejabberd:ejabberd

-> /sbin/service ejabberd start works.

status and stopping of the service still reacts in error-messages, means manual
kill of the processes.

btw, see any way to include transports in the start-script?
Comment 8 Jeffrey C. Ollie 2006-06-30 09:11:08 EDT
(In reply to comment #7)
> Okay, i have it all working now:

Great!

> - ejabberd
> - AND its initscripts
> 
> 2 things to do:
> 
> - update Erlang to erlang.i386 R11B-0.1.fc5
> - copy the CONTENT of the Mnesia-Database to /var/lib/ejabberd/spool/
> - chown the new database to ejabberd:ejabberd
> 
> -> /sbin/service ejabberd start works.
> 
> status and stopping of the service still reacts in error-messages, means manual
> kill of the processes.

Hmm... works for me here.  What is the ownership of
/var/lib/ejabberd/.erlang.cookie?

> btw, see any way to include transports in the start-script?

I've not used any transports so I don't know how they would be used.  Can you
point me to any docs?
Comment 9 Grosswiler Roger 2006-07-01 16:35:02 EDT
.erlang.cookie:

4751363 -r--------  1 ejabberd ejabberd     20 27. Jun 00:00 .erlang.cookie


Documentations:

ICQ: http://pyicq-t.blathersource.org/
MSN: http://delx.cjb.net/pymsnt/

I use only those 2, perhaps if somebody else also have some links to yahoo or
other transports?

IMHO the Pyhton-Transports are easiest to install...
Comment 10 Jeffrey C. Ollie 2006-07-03 10:18:13 EDT
What's the output of "hostname -s"?  I checked on two of my systems and "service
ejbberd status" failed on one that returned "localhost" for "hostname -s".  It
seems that what's in /etc/hosts is having an effect here...
Comment 11 Jeffrey C. Ollie 2006-07-03 10:58:25 EDT
I've submitted updated packages to the extras build system that should hopefully
fix the problem with "status" and "stop" not working.  They should show up the
next time extras RPMS are pushed.
Comment 12 Jeffrey C. Ollie 2006-07-03 11:02:33 EDT
> ICQ: http://pyicq-t.blathersource.org/
> MSN: http://delx.cjb.net/pymsnt/
> 
> I use only those 2, perhaps if somebody else also have some links to yahoo or
> other transports?
> 
> IMHO the Pyhton-Transports are easiest to install...

Since these transports are not specific to ejabberd it would be better to
package them separately from ejabberd.
Comment 13 Grosswiler Roger 2006-07-04 01:49:55 EDT
Gonna check hostname -s asap. If they are pushed already this evening, i give it
a try.

Would this be a issue for you, to get those transports yum'd too? ;-)

Comment 14 Grosswiler Roger 2006-07-04 15:41:06 EDT
See result of checking hostname:

[root@mordor ~]# hostname -s
mordor
[root@mordor ~]# hostname
mordor.gwch.net

...so seems to be alright...

Roger
Comment 15 Jeffrey C. Ollie 2006-07-06 15:02:44 EDT
(In reply to comment #13)
> Gonna check hostname -s asap. If they are pushed already this evening, i give it
> a try.

Do the new init scripts work for you?

> Would this be a issue for you, to get those transports yum'd too? ;-)

I've opened up a bug for the MSN transport (because I had a MSN Messenger
account handy to test with):

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197847

I'll look into some of the other transports too.
Comment 16 Grosswiler Roger 2006-07-07 01:41:02 EDT
(In reply to comment #15)

Hey Jeff,

Sorry, havenn't had the time to update til now and have to leave for a 14 days
vacancy. But i gonna check it out. On version 1.1.1-8, startup did work, only
the other options where "buggy"
> (In reply to comment #13)
> > Gonna check hostname -s asap. If they are pushed already this evening, i give it
> > a try.
> 
> Do the new init scripts work for you?
> 
> > Would this be a issue for you, to get those transports yum'd too? ;-)
> 
> I've opened up a bug for the MSN transport (because I had a MSN Messenger
> account handy to test with):
> 
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197847
> 
> I'll look into some of the other transports too.
> 
can i help you with this? I have them both up and running without any problem
(even if under ejabberd it takes 2 minutes to get them running ;-) )
Comment 17 Jeffrey C. Ollie 2006-07-07 10:23:48 EDT
(In reply to comment #16)
> (In reply to comment #15)
> 
> Sorry, havenn't had the time to update til now and have to leave for a 14 days
> vacancy. But i gonna check it out. On version 1.1.1-8, startup did work, only
> the other options where "buggy"

Can you please post the output from the failing commands?

> > I'll look into some of the other transports too.
> > 
> can i help you with this? I have them both up and running without any problem
> (even if under ejabberd it takes 2 minutes to get them running ;-) )

Check out the SRPM that I posted in the other bug, and post any
comments/criticisms there.  I'll have the ICQ transport ready in a few days or so.
Comment 18 Jeffrey C. Ollie 2006-07-26 09:43:04 EDT
Roger, have you had a chance to try out the most recent packages?
Comment 19 Grosswiler Roger 2006-07-27 02:00:23 EDT
not yet, just got back. gonna update this weekend and place comments and output
asap.
Comment 20 Grosswiler Roger 2006-07-28 13:36:07 EDT
hey jeff,

ok, see here: 

[root@mordor ~]# service ejabberd status
RPC failed on the node ejabberd@mordor: nodedown

=ERROR REPORT==== 28-Jul-2006::19:43:54 ===
Error in process <0.34.0> on node 'ejabberdctl@mordor' with exit value:
{badarg,[{erlang,list_to_existing_atom,["ejabberd@mordor.gwch.net"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}
Comment 21 Peter Berry 2007-05-27 17:57:47 EDT
1.1.3's init script also has no reload command, despite being documented in the
usage message:

[pwb@silver etc]$ sudo /etc/init.d/ejabberd reload
Usage: ejabberd {start|stop|restart|reload|condrestart|status}
Comment 22 Jeffrey C. Ollie 2007-07-26 11:10:18 EDT
Is this bug report still valid?  If I don't get a response in a week or so I'll
close the bug.
Comment 23 Jeffrey C. Ollie 2007-08-08 10:03:12 EDT
Closing the bug.  If this is really still an issue please reopen and update the bug.

Note You need to log in before you can comment on or make changes to this bug.