Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 158466

Summary: net-im/jabberd-2.0.11-r1 rc script does not support multiple instances of the same service
Product: Gentoo Linux Reporter: Brandon Dimcheff <bdimchef-gentoo>
Component: Current packagesAssignee: Krzysztof Pawlik (RETIRED) <nelchael>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: 2006.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 150107    
Attachments: jabberd-2.0.11.init.patch
jabberd-2.0.11.init.patch

Description Brandon Dimcheff 2006-12-18 09:01:32 UTC
I run a jabber server with more than 1 domain, so I need to have multiple "sm" lines in /etc/jabber/jabberd.cfg.

If you look at /etc/init.d/jabberd, the start() function greps for the service name (first column) and then uses that to grep for the config file name (second column).  Since there are two instances of "sm" in my file, it gets 2 filenames when looking for the config file for "sm", so it fails.  Since multiple instances of sm are required (as far as I know) to run a jabber server over multiple domains, this will likely effect anyone who is attempting to do so.
Comment 1 Krzysztof Pawlik (RETIRED) gentoo-dev 2006-12-18 15:46:54 UTC
Could you send me your /etc/jabber/jabberd.cfg?
Comment 2 Brandon Dimcheff 2006-12-18 16:29:21 UTC
/etc/jabber/jabber.cfg:

(comments removed)

router      /etc/jabber/router.xml
resolver    /etc/jabber/resolver.xml
sm          /etc/jabber/sm.wieldim.com.xml
sm          /etc/jabber/sm.dimcheff.com.xml
s2s         /etc/jabber/s2s.xml
c2s         /etc/jabber/c2s.xml
Comment 3 Krzysztof Pawlik (RETIRED) gentoo-dev 2006-12-19 02:23:28 UTC
Created attachment 104346 [details, diff]
jabberd-2.0.11.init.patch

Could you test this patch?
Comment 4 Brandon Dimcheff 2006-12-19 10:15:31 UTC
It's reading the correct files now, but it still won't launch 2 instances of sm.  I get the following output:

bdimchef@link ~ $ sudo ./jabberd start
 * Starting Jabber Server ...
 *   Starting router (/etc/jabber/router.xml) ...                                                                                         [ ok ]
 *   Starting resolver (/etc/jabber/resolver.xml) ...                                                                                     [ ok ]
 *   Starting sm (/etc/jabber/sm.wieldim.com.xml) ...                                                                                     [ ok ]
 *   Starting sm (/etc/jabber/sm.dimcheff.com.xml) ...
/usr/bin/sm already running.                                                                                                              [ !! ]
 *   Starting s2s (/etc/jabber/s2s.xml) ...                                                                                               [ ok ]
 *   Starting c2s (/etc/jabber/c2s.xml) ...                                                                                               [ ok ]


I think you might need to specify some pid files in start-stop-daemon.  The pid files themselves look like they're created by the individual jabber daemons, but the start-stop-daemon thing looks like it's just checking ps or something.    (sorry, I'm not that familiar with gentoo's rc system)

Anyhow, I couldn't find any option for start-stop-daemon that told it to launch multiple instances of the same binary.  I thought about writing something to grab the pid file locations from the files in /etc/jabber and passing them to start-stop-daemon, but that seemed like a pretty big change and I figured there may be a better way to handle this.

Thanks,
Brandon
Comment 5 Krzysztof Pawlik (RETIRED) gentoo-dev 2007-01-04 00:46:16 UTC
Created attachment 105356 [details, diff]
jabberd-2.0.11.init.patch

(In reply to comment #4)
> It's reading the correct files now, but it still won't launch 2 instances of
> sm.  I get the following output:
[....]
>  *   Starting sm (/etc/jabber/sm.wieldim.com.xml) ...                          
>                                                           [ ok ]
>  *   Starting sm (/etc/jabber/sm.dimcheff.com.xml) ...
> /usr/bin/sm already running.                                                   
[....]

Could you try this patch? It tries to workaround this issue.
Comment 6 Krzysztof Pawlik (RETIRED) gentoo-dev 2007-01-08 22:04:44 UTC
Brandon: ping
Comment 7 Brandon Dimcheff 2007-01-08 22:20:19 UTC
Sorry about that... was real busy over the weekend.  I checked it out and it works fine for me!

Thanks,
Brandon
Comment 8 Krzysztof Pawlik (RETIRED) gentoo-dev 2007-01-09 10:39:37 UTC
(In reply to comment #7)
> Sorry about that... was real busy over the weekend.  I checked it out and it
> works fine for me!

Great - sync your tree and re-emerge jabberd.