Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 382153 - net-analyzer/munin : plugin for ejabberd needs tweaking to find the configuration file
Summary: net-analyzer/munin : plugin for ejabberd needs tweaking to find the configura...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sysadmin Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 14:33 UTC by Thomas Capricelli
Modified: 2012-10-04 08:05 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2011-09-07 14:33:17 UTC
the ejabberd_ plugin will fail with: "Unable to find ejabberd.cfg. Exiting."
A quick look in the file will show 
-------------------------------------------------------
    for CFGPATH in /etc/ejabberd /usr/local/ejabberd/etc; do
    if [ -f "$CFGPATH/ejabberd.cfg" ]; then
        EJCFG=$CFGPATH/ejabberd.cfg;
    fi
    done
    if [ -z "$EJCFG" ]; then
        echo "Unable to find ejabberd.cfg. Exiting." >&2
        exit -1
    fi
-------------------------------------------------------

But on gentoo, this file is not in /etc/ejabberd, rather in /etc/jabber/. I did a local modification to the plugin, but i'd prefer this to be done by the package.

Reproducible: Always
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-09-07 14:40:18 UTC
Hmm, would you mind researching if that /etc/jabber path is a Gentoo-specific
thing. If so, we can fix it in the Gentoo munin package, otherwise the patch
should be submitted upstream.

Thanks for your assistance.
Comment 2 Thomas Capricelli 2011-09-07 14:45:54 UTC
I think the ejabberd-2.1.8.ebuild kinda changes the /etc/xx directory. It has those lines, among others:

---------------------------------------------------------------
JABBER_ETC="${EPREFIX}/etc/jabber"
    # Set correct paths
    sed -e "/^EJABBERDDIR[[:space:]]*=/{s:ejabberd:${PF}:}" \
        -e "/^ETCDIR[[:space:]]*=/{s:@sysconfdir@/ejabberd:${JABBER_ETC}:}" \
        -e "/^LOGDIR[[:space:]]*=/{s:@localstatedir@/log/ejabberd:${JABBER_LOG}:}" \
        -e "/^SPOOLDIR[[:space:]]*=/{s:@localstatedir@/lib/ejabberd:${JABBER_SPOOL}:}" \
            -i Makefile.in || die
    sed -e "/EJABBERDDIR=/{s:ejabberd:${PF}:}" \
        -e "s|\(ETCDIR=\)@SYSCONFDIR@.*|\1${JABBER_ETC}|" \
        -e "s|\(LOGS_DIR=\)@LOCALSTATEDIR@.*|\1${JABBER_LOG}|" \
        -e "s|\(SPOOLDIR=\)@LOCALSTATEDIR@.*|\1${JABBER_SPOOL}|" \
            -i ejabberdctl.template || die
---------------------------------------------------------------

Although it does not explicitely remove the /etc/ejabberd/, it's dealing with SYSCONFDIR, so i'm not sure.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-08-18 00:23:25 UTC
Please let us know if this is still a problem with version 2.0.5.
Comment 4 Thomas Capricelli 2012-08-18 01:07:40 UTC
I will, but not soon. Migrating from munin 1.x to 2.x doesn't seem as trivial as I would expect and i have quite a few servers.
It's ok for the ticket to stay on 'test-request' for some times, right ?
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-08-18 01:16:40 UTC
Yes it's fine. The migration from 1.x to 2.x should be pretty painless anyway, at least with the Gentoo packages: we default to "old-style cron" (like Debian does at this point), since CGI is ... unsafe. And that's basically the only thing that made the upgrade painful.

There are a few features that we don't yet support fully (SSH transport; asyncd) but those don't preclude the use of Munin as it was before.
Comment 6 Thomas Capricelli 2012-09-02 22:50:51 UTC
Tested today with net-analyzer/munin-2.0.5-r2

It still fails :

     verdi plugins # munin-run ejabberd_ 
     Unable to find ejabberd.cfg. Exiting.

Reading the plugin code (/usr/libexec/munin/plugins/ejabberd_ ), one can see that it still looks in /etc/ejabberd/ only. 

The plugin perldoc clearly mentions the problem in the BUG section :

--------------------------------------------------
There is no way to configure the "/etc" path.  /etc/ejabberd and /usr/local/ejabberd/etc is hardcoded in the script.
--------------------------------------------------

Now i'm quite confused... did you have any reason to hope munin2 (or the munin2 gentoo package) would kinda solve the problem ?
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-09-03 09:05:19 UTC
No simply I wanted to ask for more testing on recent versions. Will fix the plugin.
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-09-30 07:17:11 UTC
Okay so this one is queued for Munin 2.0.7 .. which was supposed to come out last week. Probably will make a new patchset for 2.0.6 tomorrow or so.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-10-03 01:31:00 UTC
Finally fixed as 2.0.7 is out and we have no patches applied beside the IPMI plugin.
Comment 10 Thomas Capricelli 2012-10-03 10:28:20 UTC
May I (gently) disagree ? I updated to net-analyzer/munin-2.0.7

------------------------------------
verdi plugins # munin-run  ejabberd_connections 
Unable to find ejabberd.cfg. Exiting.
------------------------------------

Which is not surprising, as the code still doesn't consider /etc/jabber.

I might re-explain : look for "CFGPATH" in the file "ejabberd_" installed by munin. It tries several directories when looking for the ejabberd.cfg file.
Gentoo uses "/etc/jabber", and this one is NOT looked after by the munin plugin. It is true that munin 2.0.7 has added a new path, but the one for gentoo is still not considered.. so it fails.
Comment 11 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-10-03 14:30:01 UTC
There is a configuration option now.
Comment 12 Thomas Capricelli 2012-10-04 01:19:04 UTC
yeps, I noticed it and i'm using it.

But... that means that every gentoo users that will install ejabberd and munin will have the plugin not working by default. That feels weird, doesn't it ? I mean each and every one gentoo user will have to debug/google/find the solution and configure the stuf..???
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-10-04 01:21:48 UTC
The problem is that somebody else got me the path that is in there.. and I'm actually not sure if I want to find out (again) how ejabberd works and understand why two people who should be using the same code are using different paths...

So until there's a tiebreaker... I'll keep it this way :/
Comment 14 Hans de Graaff gentoo-dev Security 2012-10-04 08:05:39 UTC
(In reply to comment #13)
> The problem is that somebody else got me the path that is in there.. and I'm
> actually not sure if I want to find out (again) how ejabberd works and
> understand why two people who should be using the same code are using
> different paths...

I guess that would be me. Quoting from my chat log:

graaff@jabber.xs4all.nl: Just add /etc/jabber to the search path in the plugin05:27:32 PM
graaff@jabber.xs4all.nl:     for CFGPATH in /etc/ejabberd /etc/jabber /usr/local/ejabberd/etc; do
05:27:57 PM
graaff@jabber.xs4all.nl: /etc/jabber is new05:28:04 PM