[Xymon] xymon.html.tmp

Jeremy Laidman jeremy at laidman.org
Tue Mar 27 14:02:09 CEST 2018


Calum

pagegen always creates a temporary file xymon.html.tmp and then
progressively fills it with the page content. Only when it's finished
making the file does it then rename it to xymon.html.

The code that closes the temporary file and renames it, is like so:

                fclose(output);
                if (rename(tmpfilename, filename)) {
                        errprintf("Cannot rename %s to %s - error %d\n",
tmpfilename, filename, errno);
                }

I'm guessing that everything works up to the rename. You might find the
reason for a rename error by checking the xymongen.log file.

My first theory was that you manually ran xymongen as root during testing,
and it created the index.html file owned by root, thus not writeable by the
xymon user. However, if the xymon user owns the directory containing the
file, it would have permission to do the rename, as it doesn't require
write permission on a file to replace or delete it. So I'm not convinced
that's the case.

Perhaps the filesystem is full?

You might also try to recompile with your code changes removed, and see if
the problem goes away. If it does, then progressively add sections of code
back until it fails again.

Cheers
Jeremy


On 27 March 2018 at 04:36, Calum Martin <cdm46 at ast.cam.ac.uk> wrote:

> Hi all,
>
> I have made some very minor changes to the pagegen.c file before
> compiling. It in no way interferes with any  of the pre-existing code. When
> running the xymon server with these small modifications, the page
> xymon.html.tmp is created in the www directory. This is instead of the
> usual xymon.html. As a result of these changes the index.html symlink
> becomes broken. Why does .tmp get appended to the xymon.html when I’ve only
> made small unobtrusive modifications?
>
> Cheers,
> Calum
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20180327/0908e332/attachment.html>


More information about the Xymon mailing list