[Xymon] path issue for XYMONNOTESDIR

Dave "doughnut" Fogarty doughnut at doughnut.net
Thu Jan 31 21:18:24 CET 2019


It looks like there's a bug in xymond_filestore.c where only the basename 
of XYMONNOTESDIR is being used.  I was able to work around it by putting a 
symlink in slash to the correct location.

lrwxrwxrwx 1 root root 31 Jan 31 12:15 /notes -> /usr/lib/xymon/server/www/notes


It seems to be an unnecessary "basename" at line 363:
 	sprintf(logfn, "%s/%s", basename(filedir), hostname);
 	expiretime = 0;
 	update_file(logfn, "w", statusdata, expiretime, NULL, -1, seq);



notes.log says:
5901 2019-01-31 12:00:30.754527 Storing tests: <all>
5901 2019-01-31 12:00:30.755415 Want msg 1, startpos 0, fillpos 0, endpos -1, usedbytes=0, bufleft=8392703
5901 2019-01-31 12:00:30.755642 Got 115 bytes
5901 2019-01-31 12:00:30.755755 filestore: Got message 1 @@notes#1/davetest.txt|1548964830.739611|127.0.0.1|davetest.txt
5901 2019-01-31 12:00:30.755865 startpos 115, fillpos 115, endpos -1
5901 2019-01-31 12:00:30.755980 Updating seq 1 file notes/davetest.txt
2019-01-31 12:00:30.761499 Child process 5901 died: Signal 6

strace showed:
[pid  5901] open("notes/.davetest.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
[pid  5901] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---



More information about the Xymon mailing list