Xymon Mailing List Archive search

xymon.html.tmp

2 messages in this thread

list Calum Martin · Mon, 26 Mar 2018 18:36:48 +0100 ·
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
list Jeremy Laidman · Tue, 27 Mar 2018 23:02:09 +1100 ·
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
quoted from Calum Martin


On 27 March 2018 at 04:36, Calum Martin <user-b038e2558502@xymon.invalid> 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