[Xymon] core dump

henrik at hswn.dk henrik at hswn.dk
Mon Jan 13 11:57:49 CET 2014


Den 13.01.2014 11:02, Stef Coene skrev:
> I have installed the client but I moved it to an other directory.
> I tried to set XYMONHOME to this new directory, but this causes
> xymonlaunch to crash with a buffer overvlow.
> This is the code from ./common/xymonlaunch.c:
[...]
>
>    else if (xgetenv("XYMONHOME")) {
>       char *pf = NULL;
>       sprintf(pf, "%s/etc/tasks.cfg", xgetenv("XYMONHOME"));
>       if (pf && stat(pf, &st) != -1) config = strdup(pf);
>    }

I have no idea how that ever got into the official code. It is so 
obviously broken I should have caught it before hitting 'commit'. Fixed.


> I also have a problem with this line from file common/xymoncmd.c:
>     sprintf(envfn, "%s/etc/xymonserver.cfg", xgetenv("XYMONHOME"));
>
> I want to run xymoncmd without setting XYMONHOME.  So it has to use
> XYMONHOME from compile time, but that's not working.

Now I'm confused. You start by saying you are working on a *client* 
installation, but xymonserver.cfg refers to a *server* installation.

> In the Makefile I set XYMONHOME to a directory but during the 
> compile, /client is added.

The "/client" in the top-level Makefile during 'configure'. If you 
don't want it, then re-build the client with XYMONHOME set the way you 
want.

Anyway, if you override XYMONHOME in your xymonclient.cfg or 
xymonserver.cfg, then it should work fine. The only problem that is to 
bootstrap it for xymonlaunch and xymoncmd (if you run that for commands 
not invoked through xymonlaunch). The easiest in that case is to add the 
--env and --config options for xymonlaunch / xymoncmd.


Regards,
Henrik




More information about the Xymon mailing list