rteval: Remove XML-RPC server
PATCH 1/1 rteval: Remove XML-RPC server
From: Tomas Glozar <[email protected]>
Remove code for rteval XML-RPC server and client as well as associated modules (rtevalMailer). The code was disabled in 2d547eb6 ("rteval:
Disable options for remote xmlrpc server").
Also remove all references to the functionality in documentation except for author credits.
--- .gitignore | 5 - Makefile | 15 +- doc/rteval.8 | 6 - doc/rteval.txt | 18 +- rteval-cmd | 6 - rteval/__init__.py | 25 - rteval/rtevalConfig.py | 1 - rteval/rtevalMailer.py | 51 -- rteval/rtevalXMLRPC.py | 97 --- rteval/rtevalclient.py | 60 -- server/COPYING | 339 -------- server/INSTALL | 302 ------- server/Logger.py | 19 - server/Makefile.am | 38 - server/README.xmlrpc | 201 ----- server/apache-rteval-wsgi.conf.tpl | 22 - server/apache-rteval.conf.tpl | 18 - server/configure.ac | 130 --- server/database.py | 238 ------ server/gen_config.sh | 14 - server/parser/Makefile.am | 30 - server/parser/README.parser | 204 ----- server/parser/argparser.c | 140 --- server/parser/argparser.h | 21 - server/parser/configparser.c | 171 ---- server/parser/configparser.h | 25 - server/parser/eurephia_nullsafe.c | 54 -- server/parser/eurephia_nullsafe.h | 103 --- server/parser/eurephia_values.c | 301 ------- server/parser/eurephia_values.h | 48 -- server/parser/eurephia_values_struct.h | 38 - server/parser/eurephia_xml.c | 147 ---- server/parser/eurephia_xml.h | 43 - server/parser/log.c | 228 ----- server/parser/log.h | 43 - server/parser/parsethread.c | 370 -------- server/parser/parsethread.h | 38 - server/parser/pgsql.c | 1093 ------------------------ server/parser/pgsql.h | 58 -- server/parser/rteval-parserd.c | 533 ------------ server/parser/rteval-parserd.init | 126 --- server/parser/rteval-parserd.sysconfig | 23 - server/parser/sha1.c | 615 ------------- server/parser/sha1.h | 66 -- server/parser/statuses.h | 33 - server/parser/threadinfo.h | 38 - server/parser/xmlparser.c | 620 -------------- server/parser/xmlparser.h | 75 -- server/parser/xmlparser.xsl | 607 ------------- server/remove_rtevalrun | 65 -- server/rteval-parser.spec | 133 --- server/rteval_testserver.py | 107 --- server/rteval_xmlrpc.py | 71 -- server/rteval_xmlrpc.wsgi | 94 -- server/rtevaldb.py | 57 -- server/sql/delta-1.0_1.1.sql | 15 - server/sql/delta-1.1_1.2.sql | 9 - server/sql/delta-1.2_1.3.sql | 6 - server/sql/delta-1.3_1.4.sql | 6 - server/sql/delta-1.4_1.5.sql | 31 - server/sql/rteval-1.0.sql | 189 ---- server/sql/rteval-1.1.sql | 203 ----- server/sql/rteval-1.2.sql | 207 ----- server/sql/rteval-1.3.sql | 208 ----- server/sql/rteval-1.4.sql | 209 ----- server/sql/rteval-1.5.sql | 235 ----- server/testclient.py | 37 - server/testclient_sendreportfile | 36 - server/unittest.py | 91 -- server/xmlrpc_API1.py | 100 --- unit-tests/unittest.py | 1 - 71 files changed, 2 insertions(+), 9604 deletions(-) delete mode 100644 rteval/rtevalMailer.py delete mode 100644 rteval/rtevalXMLRPC.py delete mode 100644 rteval/rtevalclient.py delete mode 100644 server/COPYING delete mode 100644 server/INSTALL delete mode 100644 server/Logger.py delete mode 100644 server/Makefile.am delete mode 100644 server/README.xmlrpc delete mode 100644 server/apache-rteval-wsgi.conf.tpl delete mode 100644 server/apache-rteval.conf.tpl delete mode 100644 server/configure.ac delete mode 100644 server/database.py delete mode 100755 server/gen_config.sh delete mode 100644 server/parser/Makefile.am delete mode 100644 server/parser/README.parser delete mode 100644 server/parser/argparser.c delete mode 100644 server/parser/argparser.h delete mode 100644 server/parser/configparser.c delete mode 100644 server/parser/configparser.h delete mode 100644 server/parser/eurephia_nullsafe.c delete mode 100644 server/parser/eurephia_nullsafe.h delete mode 100644 server/parser/eurephia_values.c delete mode 100644 server/parser/eurephia_values.h delete mode 100644 server/parser/eurephia_values_struct.h delete mode 100644 server/parser/eurephia_xml.c delete mode 100644 server/parser/eurephia_xml.h delete mode 100644 server/parser/log.c delete mode 100644 server/parser/log.h delete mode 100644 server/parser/parsethread.c delete mode 100644 server/parser/parsethread.h delete mode 100644 server/parser/pgsql.c delete mode 100644 server/parser/pgsql.h delete mode 100644 server/parser/rteval-parserd.c delete mode 100755 server/parser/rteval-parserd.init delete mode 100644 server/parser/rteval-parserd.sysconfig delete mode 100644 server/parser/sha1.c delete mode 100644 server/parser/sha1.h delete mode 100644 server/parser/statuses.h delete mode 100644 server/parser/threadinfo.h delete mode 100644 server/parser/xmlparser.c delete mode 100644 server/parser/xmlparser.h delete mode 100644 server/parser/xmlparser.xsl delete mode 100755 server/remove_rtevalrun delete mode 100644 server/rteval-parser.spec delete mode 100644 server/rteval_testserver.py delete mode 100644 server/rteval_xmlrpc.py delete mode 100644 server/rteval_xmlrpc.wsgi delete mode 100644 server/rtevaldb.py delete mode 100644 server/sql/delta-1.0_1.1.sql delete mode 100644 server/sql/delta-1.1_1.2.sql delete mode 100644 server/sql/delta-1.2_1.3.sql delete mode 100644 server/sql/delta-1.3_1.4.sql delete mode 100644 server/sql/delta-1.4_1.5.sql delete mode 100644 server/sql/rteval-1.0.sql delete mode 100644 server/sql/rteval-1.1.sql delete mode 100644 server/sql/rteval-1.2.sql delete mode 100644 server/sql/rteval-1.3.sql delete mode 100644 server/sql/rteval-1.4.sql delete mode 100644 server/sql/rteval-1.5.sql delete mode 100644 server/testclient.py delete mode 100755 server/testclient_sendreportfile delete mode 100644 server/unittest.py delete mode 100644 server/xmlrpc_API1.py
.gitignore +0 -5
@@ -27,9 +27,4 @@ MANIFEST .deps stamp-h1 autom4te.cache/ -server/Makefile -server/config.log -server/config.status -server/parser/Makefile -server/parser/config.h rteval-[0-9]*
Makefile +1 -14
@@ -9,10 +9,6 @@ PACKAGE := rteval VERSION := $(shell $(PYTHON) -c "from rteval import RTEVAL_VERSION; print(RTEVAL_VERSION)") D := 10 -# XML-RPC related files -XMLRPCVER := 1.6 -XMLRPCDIR := server - DESTDIR := PREFIX := /usr DATADIR := $(DESTDIR)/$(PREFIX)/share
@@ -35,11 +31,9 @@ sysreport: $(PYTHON) rteval-cmd -D -v --workdir=$(HERE)/run --loaddir=$(HERE)/loadsource --duration=$(D) -i $(HERE)/rteval --sysreport clean: - [ -f $(XMLRPCDIR)/Makefile ] && make -C $(XMLRPCDIR) clean || echo -n - rm -f *~ rteval/*~ rteval/*.py[co] *.tar.bz2 *.tar.gz doc/*~ server/rteval-xmlrpc-*.tar.gz + rm -f *~ rteval/*~ rteval/*.py[co] *.tar.bz2 *.tar.gz doc/*~ realclean: clean - [ -f $(XMLRPCDIR)/Makefile ] && make -C $(XMLRPCDIR) maintainer-clean || echo -n rm -rf run install: install_loads install_rteval
@@ -67,13 +61,6 @@ rteval-$(VERSION).tar.bz2: mv dist/rteval-$(VERSION).tar.bz2 . rmdir dist -rteval-xmlrpc-$(XMLRPCVER).tar.gz : - cd $(XMLRPCDIR) ; \ - autoreconf --install ; \ - ./configure --prefix=$(PREFIX) ; \ - make distcheck - cp $(XMLRPCDIR)/rteval-xmlrpc-$(XMLRPCVER).tar.gz $(HERE)/ - help: @echo "" @echo "rteval Makefile targets:"
doc/rteval.8 +0 -6
@@ -84,12 +84,6 @@ information on the running system. .B \-D, \-\-debug Turn on debugging prints during run .TP -.B \-X HOST, \-\-xmprpc-submit=HOST -Have rteval send report data to HOST following the run, using XML-RPC -.TP -.B \-P, \-\-xmlrpc-no-abort -Do not abort if XML-RPC server do not respond to ping request -.TP .B \-Z, \-\-summarize Have rteval summarize an existing report. This will not cause loads or meausurement utilities to be run.
doc/rteval.txt +1 -17
@@ -33,8 +33,7 @@ boost the system load. Rteval runs for a specified length of time (typically 12 hours). When an rteval run is completed, a statisical analysis of the results is done, an XML file is generated, containing system state, raw result -data and statistical analysis results and optionally the XML is sent -by XML-RPC to a database for reporting. +data and statistical analysis results. The Load Applications ---------------------
@@ -228,18 +227,3 @@ A --numa option was added to the cyclictest program to use the libnuma library to bind threads to local memory nodes and allocate memory on the closest memory node, so to minimize the time required to access memory. - -Further Development -------------------- - -Once we started getting rteval run information it was natural that we -would want to store it in a database for further analysis (especially -watching for performance regressions). David Sommerseth created a set -of tables for a PostgreSQL database and then added an option to rteval -to ship the results back to a database server using XML-RPC. This -option is currently used internally at Red Hat do ship rteval run data -back to our internal DB server. There are no plans to open this data -up to the public, but the XML-RPC code is there if someone else wants -to use the facility. (No, there are no backdoors in the code that ship -run data back to Red Hat; it's Python code, look and see!). -
rteval-cmd +0 -6
@@ -122,12 +122,6 @@ def parse_options(cfg, parser, cmdargs): parser.add_argument("-D", '--debug', dest='rteval___debugging', action='store_true', default=rtevcfg.debugging, help=f'turn on debug prints (default: {rtevcfg.debugging})') - #parser.add_option("-X", '--xmlrpc-submit', dest='rteval___xmlrpc', - # action='store', default=rtevcfg.xmlrpc, metavar='HOST', - # help='Hostname to XML-RPC server to submit reports') - #parser.add_option("-P", "--xmlrpc-no-abort", dest="rteval___xmlrpc_noabort", - # action='store_true', default=False, - # help="Do not abort if XML-RPC server do not respond to ping request"); parser.add_argument("-Z", '--summarize', dest='rteval___summarize', action='store_true', default=False, help='summarize an already existing XML report')
rteval/__init__.py +0 -25
@@ -22,10 +22,8 @@ import sysconfig from rteval.modules.loads import LoadModules from rteval.modules.measurement import MeasurementModules, MeasurementProfile from rteval.rtevalReport import rtevalReport -from rteval.rtevalXMLRPC import rtevalXMLRPC from rteval.Log import Log from rteval import rtevalConfig -from rteval import rtevalMailer from rteval import version RTEVAL_VERSION = version.RTEVAL_VERSION
@@ -70,12 +68,6 @@ class RtEval(rtevalReport): from .sysinfo import SystemInfo self._sysinfo = SystemInfo(self.__rtevcfg, logger=self.__logger) - # prepare a mailer, if that's configured - if self.__cfg.HasSection('smtp'): - self.__mailer = rtevalMailer.rtevalMailer(self.__cfg.GetSection('smtp')) - else: - self.__mailer = None - if not os.path.exists(self.__rtevcfg.xslt_report): raise RuntimeError(f"can't find XSL template ({self.__rtevcfg.xslt_report})!")
@@ -91,19 +83,6 @@ class RtEval(rtevalReport): rtevalReport.__init__(self, self.__version, self.__rtevcfg.installdir, self.__rtevcfg.annotate) - # If --xmlrpc-submit is given, check that we can access the server - if self.__rtevcfg.xmlrpc: - self.__xmlrpc = rtevalXMLRPC(self.__rtevcfg.xmlrpc, self.__logger, self.__mailer) - if not self.__xmlrpc.Ping(): - if not self.__rtevcfg.xmlrpc_noabort: - print(f"ERROR: Could not reach XML-RPC server '{self.__rtevcfg.xmlrpc}'. Aborting.") - sys.exit(2) - else: - print("WARNING: Could not ping the XML-RPC server. Will continue anyway.") - else: - self.__xmlrpc = None - - @staticmethod def __show_remaining_time(remaining): secs = int(remaining)
@@ -271,10 +250,6 @@ class RtEval(rtevalReport): if self.__rtevcfg.sysreport: self._sysinfo.run_sysreport(self.__reportdir) - # if --xmlrpc-submit | -X was given, send our report to the given host - if self.__xmlrpc: - rtevalres = self.__xmlrpc.SendReport(self.GetXMLreport()) - if earlystop: rtevalres = 1 self._sysinfo.copy_dmesg(self.__reportdir)
rteval/rtevalConfig.py +0 -1
@@ -73,7 +73,6 @@ default_config = { 'workdir' : os.getcwd(), 'installdir' : installdir, 'srcdir' : default_config_search(['loadsource']), - 'xmlrpc' : None, 'xslt_report': default_config_search(['rteval_text.xsl'], os.path.isfile), 'xslt_histogram': default_config_search(['rteval_histogram_raw.xsl'], os.path.isfile), 'report_interval': '600',
rteval/rtevalMailer.py deleted +0 -51
51 lines not on this page · raw message
rteval/rtevalXMLRPC.py deleted +0 -97
97 lines not on this page · raw message
rteval/rtevalclient.py deleted +0 -60
60 lines not on this page · raw message
server/COPYING deleted +0 -339
339 lines not on this page · raw message
server/INSTALL deleted +0 -302
302 lines not on this page · raw message
server/Logger.py deleted +0 -19
@@ -1,19 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -import sys -from datetime import datetime - -class Logger(): - def __init__(self, logfile, prefix): - self.log = sys.stdout - self.logopen = True - self.prefix = prefix - - def Log(self, grp, msg): - if self.logopen == True: - tstmp = datetime.today().strftime("%Y-%m-%d %H:%M:%S") - self.log.write("%s [%s::%s]: %s\n" % (tstmp, self.prefix, grp, msg)) - self.log.flush() - - def LogFD(self): - return self.log.fileno() -
server/Makefile.am deleted +0 -38
@@ -1,38 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Makefile.am - autotools configuration file -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# -SUBDIRS = parser -dist_doc_DATA = parser/README.parser \ - sql/delta-1.0_1.1.sql \ - sql/delta-1.1_1.2.sql \ - sql/delta-1.2_1.3.sql \ - sql/delta-1.3_1.4.sql \ - sql/rteval-$(SQLSCHEMAVER).sql - -apache-rteval.conf: -if ENAB_MODPYTHON - [ -n $(XMLRPCROOT) ] && $(srcdir)/gen_config.sh apache-rteval.conf $(XMLRPCROOT)/API1 -else - [ -n $(XMLRPCROOT) ] && $(srcdir)/gen_config.sh apache-rteval-wsgi.conf $(XMLRPCROOT)/API1 -endif - -clean-local: - -rm -f apache-rteval.conf *~ - -dist-hook: - cp $(srcdir)/gen_config.sh $(srcdir)/apache-rteval.conf.tpl $(srcdir)/apache-rteval-wsgi.conf.tpl $(distdir)/ - -rm -f $(distdir)/apache-rteval.conf - -if ENAB_XMLRPC - xmlrpcdir = $(XMLRPCROOT)/API1 - BUILT_SOURCES = apache-rteval.conf - dist_doc_DATA += README.xmlrpc apache-rteval.conf - dist_xmlrpc_DATA = xmlrpc_API1.py rtevaldb.py database.py -if ENAB_MODPYTHON - dist_xmlrpc_DATA += rteval_xmlrpc.py -else - dist_xmlrpc_DATA += rteval_xmlrpc.wsgi -endif -endif
server/README.xmlrpc deleted +0 -201
201 lines not on this page · raw message
server/apache-rteval-wsgi.conf.tpl deleted +0 -22
@@ -1,22 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# File: apache-rteval.conf -# -# Apache config entry to enable the rteval XML-RPC server -# -# Copyright 2011 - 2013 David Sommerseth <[email protected]> -# - -WSGISocketPrefix /var/run/wsgi -WSGIDaemonProcess rtevalxmlrpc processes=3 threads=15 python-path={_INSTALLDIR_} -WSGIScriptAlias /rteval/API1 {_INSTALLDIR_}/rteval_xmlrpc.wsgi - -<Directory "{_INSTALLDIR_}"> - Options Indexes FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - - WSGIProcessGroup rtevalxmlrpc - WSGICallableObject rtevalXMLRPC_handler -</Directory> -
server/apache-rteval.conf.tpl deleted +0 -18
@@ -1,18 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# File: apache-rteval.conf -# -# Apache config entry to enable the rteval XML-RPC server -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# -<Directory "{_INSTALLDIR_}"> - Options Indexes FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - - SetHandler python-program - PythonHandler rteval_xmlrpc - PythonDebug On -</Directory> -
server/configure.ac deleted +0 -130
130 lines not on this page · raw message
server/database.py deleted +0 -238
238 lines not on this page · raw message
server/gen_config.sh deleted +0 -14
@@ -1,14 +0,0 @@ -#/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later - -APACHECONF="$1" -INSTALLDIR="$2" - -echo "Creating Apache config file: apache-rteval.conf" -escinstpath="$(echo ${INSTALLDIR} | sed -e 's/\//\\\\\//g')" -expr=$(echo "s/{_INSTALLDIR_}/${escinstpath}/") -eval "sed -e ${expr} ${APACHECONF}.tpl" > apache-rteval.conf -echo "Copy the apache apache-rteval.conf into your Apache configuration" -echo "directory and restart your web server" -echo -
server/parser/Makefile.am deleted +0 -30
@@ -1,30 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Makefile.am - autotools configuration file -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# - -# Generic include files, found by ./configure -AM_CPPFLAGS = $(LIBXML2_INC) $(LIBXSLT_INC) $(LIBPQ_INC) -std=gnu89 - -# What is required to build rteval_parserd -bin_PROGRAMS = rteval-parserd -rteval_parserd_SOURCES = argparser.c argparser.h \ - configparser.c configparser.h \ - eurephia_nullsafe.c eurephia_nullsafe.h eurephia_values_struct.h \ - eurephia_values.c eurephia_values.h \ - eurephia_xml.c eurephia_xml.h \ - log.c log.h \ - parsethread.c parsethread.h threadinfo.h \ - pgsql.c pgsql.h \ - sha1.c sha1.h \ - xmlparser.c xmlparser.h \ - rteval-parserd.c statuses.h - -# Don't build, only install -xsltdir=$(datadir)/rteval -dist_xslt_DATA = xmlparser.xsl - -# Copy init script and config file example to the docs dir -initscriptdir=$(docdir)/initscripts -dist_initscript_DATA = rteval-parserd.init rteval-parserd.sysconfig
server/parser/README.parser deleted +0 -204
204 lines not on this page · raw message
server/parser/argparser.c deleted +0 -140
140 lines not on this page · raw message
server/parser/argparser.h deleted +0 -21
@@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* Copyright (C) 2009 Red Hat Inc. -* -*/ - -/** -* @file argparser.h -* @author David Sommerseth <[email protected]> -* @date Thu Oct 22 13:58:46 2009 -* -* @brief Generic argument parser -* -*/ - -#ifndef _RTEVAL_ARGPARSER_h -#define _RTEVAL_ARGPARSER_h - -eurephiaVALUES *parse_arguments (int argc,char **argv); - -#endif
server/parser/configparser.c deleted +0 -171
171 lines not on this page · raw message
server/parser/configparser.h deleted +0 -25
@@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* configparser.h - Read and parse config files -* -* This code is based on the fragments from the eurephia project. -* -* GPLv2 Copyright (C) 2009 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file configparser.h -* @author David Sommerseth <[email protected]> -* @date 2009-10-01 -* -* @brief Config file parser -* -*/ - -#ifndef _CONFIGPARSER_H -#define _CONFIGPARSER_H - -eurephiaVALUES *read_config (LogContext *log,eurephiaVALUES *prgargs,const char *section); - -#endif
server/parser/eurephia_nullsafe.c deleted +0 -54
54 lines not on this page · raw message
server/parser/eurephia_nullsafe.h deleted +0 -103
103 lines not on this page · raw message
server/parser/eurephia_values.c deleted +0 -301
301 lines not on this page · raw message
server/parser/eurephia_values.h deleted +0 -48
48 lines not on this page · raw message
server/parser/eurephia_values_struct.h deleted +0 -38
@@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* eurephia_values.h -- eurephiaVALUES struct typedef -* -* GPLv2 only - Copyright (C) 2008 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_values_struct.h -* @author David Sommerseth <[email protected]> -* @date 2008-11-05 -* -* @brief Definition of the eurephiaVALUES struct -* -*/ - -#ifndef EUREPHIA_VALUES_STRUCT_H_ -# define EUREPHIA_VALUES_STRUCT_H_ - -#include <log.h> - -/** -* eurephiaVALUES is a pointer chain with key/value pairs. If having several -* such pointer chains, they can be given different group IDs to separate them, -* which is especially useful during debugging. -* -*/ -typedef struct __eurephiaVALUES { -LogContext *log;/**< Pointer to an established log context, used for logging */ -unsigned int evgid;/**< Group ID, all elements in the same chain should have the same value */ -unsigned int evid;/**< Unique ID per element in a pointer chain */ -char *key;/**< The key name of a value */ -char *val;/**< The value itself */ -struct __eurephiaVALUES *next;/**< Pointer to the next element in the chain. NULL == end of chain */ -}eurephiaVALUES ; - -#endif /* !EUREPHIA_VALUES_STRUCT_H_ */
server/parser/eurephia_xml.c deleted +0 -147
147 lines not on this page · raw message
server/parser/eurephia_xml.h deleted +0 -43
36 lines not on this page · raw message
server/parser/log.c deleted +0 -228
228 lines not on this page · raw message
server/parser/log.h deleted +0 -43
43 lines not on this page · raw message
server/parser/parsethread.c deleted +0 -370
370 lines not on this page · raw message
server/parser/pgsql.c deleted +0 -1093
1,093 lines not on this page · raw message
server/parser/pgsql.h deleted +0 -58
58 lines not on this page · raw message
server/parser/rteval-parserd.c deleted +0 -533
533 lines not on this page · raw message
server/parser/rteval-parserd.init deleted +0 -126
126 lines not on this page · raw message
server/parser/rteval-parserd.sysconfig deleted +0 -23
Lines of this file are not shown. View the raw message.
server/parser/sha1.c deleted +0 -615
615 lines not on this page · raw message
server/parser/sha1.h deleted +0 -66
66 lines not on this page · raw message
server/parser/xmlparser.c deleted +0 -620
620 lines not on this page · raw message
server/parser/xmlparser.h deleted +0 -75
75 lines not on this page · raw message
server/parser/xmlparser.xsl deleted +0 -607
607 lines not on this page · raw message
server/remove_rtevalrun deleted +0 -65
65 lines not on this page · raw message
server/rteval-parser.spec deleted +0 -133
133 lines not on this page · raw message
server/rteval_testserver.py deleted +0 -107
107 lines not on this page · raw message
server/rteval_xmlrpc.py deleted +0 -71
71 lines not on this page · raw message
server/rteval_xmlrpc.wsgi deleted +0 -94
94 lines not on this page · raw message
server/rtevaldb.py deleted +0 -57
57 lines not on this page · raw message
server/sql/rteval-1.0.sql deleted +0 -189
189 lines not on this page · raw message
server/sql/rteval-1.1.sql deleted +0 -203
203 lines not on this page · raw message
server/sql/rteval-1.2.sql deleted +0 -207
207 lines not on this page · raw message
server/sql/rteval-1.3.sql deleted +0 -208
208 lines not on this page · raw message
server/sql/rteval-1.4.sql deleted +0 -209
209 lines not on this page · raw message
server/sql/rteval-1.5.sql deleted +0 -235
235 lines not on this page · raw message
server/testclient_sendreportfile deleted +0 -36
Lines of this file are not shown. View the raw message.
server/unittest.py deleted +0 -91
91 lines not on this page · raw message
server/xmlrpc_API1.py deleted +0 -100
100 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.44.0
Part of the diff is not shown here. View the raw message.
unit-tests/unittest.py
Quoted 10,261 lines · On Wed, 20 Mar 2024, [email protected] wrote:
From: Tomas Glozar <[email protected]>
Remove code for rteval XML-RPC server and client as well as associated modules (rtevalMailer). The code was disabled in
2d547eb6("rteval:
Disable options for remote xmlrpc server").Also remove all references to the functionality in documentation except for author credits.
Signed-off-by Tomas Glozar <[email protected]>--- .gitignore | 5 - Makefile | 15 +- doc/rteval.8 | 6 - doc/rteval.txt | 18 +- rteval-cmd | 6 - rteval/__init__.py | 25 - rteval/rtevalConfig.py | 1 - rteval/rtevalMailer.py | 51 -- rteval/rtevalXMLRPC.py | 97 --- rteval/rtevalclient.py | 60 -- server/COPYING | 339 -------- server/INSTALL | 302 ------- server/Logger.py | 19 - server/Makefile.am | 38 - server/README.xmlrpc | 201 ----- server/apache-rteval-wsgi.conf.tpl | 22 - server/apache-rteval.conf.tpl | 18 - server/configure.ac | 130 --- server/database.py | 238 ------ server/gen_config.sh | 14 - server/parser/Makefile.am | 30 - server/parser/README.parser | 204 ----- server/parser/argparser.c | 140 --- server/parser/argparser.h | 21 - server/parser/configparser.c | 171 ---- server/parser/configparser.h | 25 - server/parser/eurephia_nullsafe.c | 54 -- server/parser/eurephia_nullsafe.h | 103 --- server/parser/eurephia_values.c | 301 ------- server/parser/eurephia_values.h | 48 -- server/parser/eurephia_values_struct.h | 38 - server/parser/eurephia_xml.c | 147 ---- server/parser/eurephia_xml.h | 43 - server/parser/log.c | 228 ----- server/parser/log.h | 43 - server/parser/parsethread.c | 370 -------- server/parser/parsethread.h | 38 - server/parser/pgsql.c | 1093 ------------------------ server/parser/pgsql.h | 58 -- server/parser/rteval-parserd.c | 533 ------------ server/parser/rteval-parserd.init | 126 --- server/parser/rteval-parserd.sysconfig | 23 - server/parser/sha1.c | 615 ------------- server/parser/sha1.h | 66 -- server/parser/statuses.h | 33 - server/parser/threadinfo.h | 38 - server/parser/xmlparser.c | 620 -------------- server/parser/xmlparser.h | 75 -- server/parser/xmlparser.xsl | 607 ------------- server/remove_rtevalrun | 65 -- server/rteval-parser.spec | 133 --- server/rteval_testserver.py | 107 --- server/rteval_xmlrpc.py | 71 -- server/rteval_xmlrpc.wsgi | 94 -- server/rtevaldb.py | 57 -- server/sql/delta-1.0_1.1.sql | 15 - server/sql/delta-1.1_1.2.sql | 9 - server/sql/delta-1.2_1.3.sql | 6 - server/sql/delta-1.3_1.4.sql | 6 - server/sql/delta-1.4_1.5.sql | 31 - server/sql/rteval-1.0.sql | 189 ---- server/sql/rteval-1.1.sql | 203 ----- server/sql/rteval-1.2.sql | 207 ----- server/sql/rteval-1.3.sql | 208 ----- server/sql/rteval-1.4.sql | 209 ----- server/sql/rteval-1.5.sql | 235 ----- server/testclient.py | 37 - server/testclient_sendreportfile | 36 - server/unittest.py | 91 -- server/xmlrpc_API1.py | 100 --- unit-tests/unittest.py | 1 - 71 files changed, 2 insertions(+), 9604 deletions(-) delete mode 100644 rteval/rtevalMailer.py delete mode 100644 rteval/rtevalXMLRPC.py delete mode 100644 rteval/rtevalclient.py delete mode 100644 server/COPYING delete mode 100644 server/INSTALL delete mode 100644 server/Logger.py delete mode 100644 server/Makefile.am delete mode 100644 server/README.xmlrpc delete mode 100644 server/apache-rteval-wsgi.conf.tpl delete mode 100644 server/apache-rteval.conf.tpl delete mode 100644 server/configure.ac delete mode 100644 server/database.py delete mode 100755 server/gen_config.sh delete mode 100644 server/parser/Makefile.am delete mode 100644 server/parser/README.parser delete mode 100644 server/parser/argparser.c delete mode 100644 server/parser/argparser.h delete mode 100644 server/parser/configparser.c delete mode 100644 server/parser/configparser.h delete mode 100644 server/parser/eurephia_nullsafe.c delete mode 100644 server/parser/eurephia_nullsafe.h delete mode 100644 server/parser/eurephia_values.c delete mode 100644 server/parser/eurephia_values.h delete mode 100644 server/parser/eurephia_values_struct.h delete mode 100644 server/parser/eurephia_xml.c delete mode 100644 server/parser/eurephia_xml.h delete mode 100644 server/parser/log.c delete mode 100644 server/parser/log.h delete mode 100644 server/parser/parsethread.c delete mode 100644 server/parser/parsethread.h delete mode 100644 server/parser/pgsql.c delete mode 100644 server/parser/pgsql.h delete mode 100644 server/parser/rteval-parserd.c delete mode 100755 server/parser/rteval-parserd.init delete mode 100644 server/parser/rteval-parserd.sysconfig delete mode 100644 server/parser/sha1.c delete mode 100644 server/parser/sha1.h delete mode 100644 server/parser/statuses.h delete mode 100644 server/parser/threadinfo.h delete mode 100644 server/parser/xmlparser.c delete mode 100644 server/parser/xmlparser.h delete mode 100644 server/parser/xmlparser.xsl delete mode 100755 server/remove_rtevalrun delete mode 100644 server/rteval-parser.spec delete mode 100644 server/rteval_testserver.py delete mode 100644 server/rteval_xmlrpc.py delete mode 100644 server/rteval_xmlrpc.wsgi delete mode 100644 server/rtevaldb.py delete mode 100644 server/sql/delta-1.0_1.1.sql delete mode 100644 server/sql/delta-1.1_1.2.sql delete mode 100644 server/sql/delta-1.2_1.3.sql delete mode 100644 server/sql/delta-1.3_1.4.sql delete mode 100644 server/sql/delta-1.4_1.5.sql delete mode 100644 server/sql/rteval-1.0.sql delete mode 100644 server/sql/rteval-1.1.sql delete mode 100644 server/sql/rteval-1.2.sql delete mode 100644 server/sql/rteval-1.3.sql delete mode 100644 server/sql/rteval-1.4.sql delete mode 100644 server/sql/rteval-1.5.sql delete mode 100644 server/testclient.py delete mode 100755 server/testclient_sendreportfile delete mode 100644 server/unittest.py delete mode 100644 server/xmlrpc_API1.py.gitignore +0
-5@@ -27,9 +27,4 @@ MANIFEST .deps stamp-h1 autom4te.cache/ -server/Makefile -server/config.log -server/config.status -server/parser/Makefile -server/parser/config.h rteval-[0-9]*Makefile +1
-14@@ -9,10 +9,6 @@ PACKAGE := rteval VERSION := $(shell $(PYTHON) -c "from rteval import RTEVAL_VERSION; print(RTEVAL_VERSION)") D := 10 -# XML-RPC related files -XMLRPCVER := 1.6 -XMLRPCDIR := server - DESTDIR := PREFIX := /usr DATADIR := $(DESTDIR)/$(PREFIX)/share@@ -35,11 +31,9 @@ sysreport: $(PYTHON) rteval-cmd -D -v --workdir=$(HERE)/run --loaddir=$(HERE)/loadsource --duration=$(D) -i $(HERE)/rteval --sysreport clean: - [ -f $(XMLRPCDIR)/Makefile ] && make -C $(XMLRPCDIR) clean || echo -n - rm -f *~ rteval/*~ rteval/*.py[co] *.tar.bz2 *.tar.gz doc/*~ server/rteval-xmlrpc-*.tar.gz + rm -f *~ rteval/*~ rteval/*.py[co] *.tar.bz2 *.tar.gz doc/*~ realclean: clean - [ -f $(XMLRPCDIR)/Makefile ] && make -C $(XMLRPCDIR) maintainer-clean || echo -n rm -rf run install: install_loads install_rteval@@ -67,13 +61,6 @@ rteval-$(VERSION).tar.bz2: mv dist/rteval-$(VERSION).tar.bz2 . rmdir dist -rteval-xmlrpc-$(XMLRPCVER).tar.gz : - cd $(XMLRPCDIR) ; \ - autoreconf --install ; \ - ./configure --prefix=$(PREFIX) ; \ - make distcheck - cp $(XMLRPCDIR)/rteval-xmlrpc-$(XMLRPCVER).tar.gz $(HERE)/ - help: @echo "" @echo "rteval Makefile targets:"doc/rteval.8 +0
-6@@ -84,12 +84,6 @@ information on the running system. .B \-D, \-\-debug Turn on debugging prints during run .TP -.B \-X HOST, \-\-xmprpc-submit=HOST -Have rteval send report data to HOST following the run, using XML-RPC -.TP -.B \-P, \-\-xmlrpc-no-abort -Do not abort if XML-RPC server do not respond to ping request -.TP .B \-Z, \-\-summarize Have rteval summarize an existing report. This will not cause loads or meausurement utilities to be run.doc/rteval.txt +1
-17@@ -33,8 +33,7 @@ boost the system load. Rteval runs for a specified length of time (typically 12 hours). When an rteval run is completed, a statisical analysis of the results is done, an XML file is generated, containing system state, raw result -data and statistical analysis results and optionally the XML is sent -by XML-RPC to a database for reporting. +data and statistical analysis results. The Load Applications ---------------------@@ -228,18 +227,3 @@ A --numa option was added to the cyclictest program to use the libnuma library to bind threads to local memory nodes and allocate memory on the closest memory node, so to minimize the time required to access memory. - -Further Development -------------------- - -Once we started getting rteval run information it was natural that we -would want to store it in a database for further analysis (especially -watching for performance regressions). David Sommerseth created a set -of tables for a PostgreSQL database and then added an option to rteval -to ship the results back to a database server using XML-RPC. This -option is currently used internally at Red Hat do ship rteval run data -back to our internal DB server. There are no plans to open this data -up to the public, but the XML-RPC code is there if someone else wants -to use the facility. (No, there are no backdoors in the code that ship -run data back to Red Hat; it's Python code, look and see!). -rteval-cmd +0
-6@@ -122,12 +122,6 @@ def parse_options(cfg, parser, cmdargs): parser.add_argument("-D", '--debug', dest='rteval___debugging', action='store_true', default=rtevcfg.debugging, help=f'turn on debug prints (default: {rtevcfg.debugging})') - #parser.add_option("-X", '--xmlrpc-submit', dest='rteval___xmlrpc', - # action='store', default=rtevcfg.xmlrpc, metavar='HOST', - # help='Hostname to XML-RPC server to submit reports') - #parser.add_option("-P", "--xmlrpc-no-abort", dest="rteval___xmlrpc_noabort", - # action='store_true', default=False, - # help="Do not abort if XML-RPC server do not respond to ping request"); parser.add_argument("-Z", '--summarize', dest='rteval___summarize', action='store_true', default=False, help='summarize an already existing XML report')rteval/__init__.py +0
-25@@ -22,10 +22,8 @@ import sysconfig from rteval.modules.loads import LoadModules from rteval.modules.measurement import MeasurementModules, MeasurementProfile from rteval.rtevalReport import rtevalReport -from rteval.rtevalXMLRPC import rtevalXMLRPC from rteval.Log import Log from rteval import rtevalConfig -from rteval import rtevalMailer from rteval import version RTEVAL_VERSION = version.RTEVAL_VERSION@@ -70,12 +68,6 @@ class RtEval(rtevalReport): from .sysinfo import SystemInfo self._sysinfo = SystemInfo(self.__rtevcfg, logger=self.__logger) - # prepare a mailer, if that's configured - if self.__cfg.HasSection('smtp'): - self.__mailer = rtevalMailer.rtevalMailer(self.__cfg.GetSection('smtp')) - else: - self.__mailer = None - if not os.path.exists(self.__rtevcfg.xslt_report): raise RuntimeError(f"can't find XSL template ({self.__rtevcfg.xslt_report})!")@@ -91,19 +83,6 @@ class RtEval(rtevalReport): rtevalReport.__init__(self, self.__version, self.__rtevcfg.installdir, self.__rtevcfg.annotate) - # If --xmlrpc-submit is given, check that we can access the server - if self.__rtevcfg.xmlrpc: - self.__xmlrpc = rtevalXMLRPC(self.__rtevcfg.xmlrpc, self.__logger, self.__mailer) - if not self.__xmlrpc.Ping(): - if not self.__rtevcfg.xmlrpc_noabort: - print(f"ERROR: Could not reach XML-RPC server '{self.__rtevcfg.xmlrpc}'. Aborting.") - sys.exit(2) - else: - print("WARNING: Could not ping the XML-RPC server. Will continue anyway.") - else: - self.__xmlrpc = None - - @staticmethod def __show_remaining_time(remaining): secs = int(remaining)@@ -271,10 +250,6 @@ class RtEval(rtevalReport): if self.__rtevcfg.sysreport: self._sysinfo.run_sysreport(self.__reportdir) - # if --xmlrpc-submit | -X was given, send our report to the given host - if self.__xmlrpc: - rtevalres = self.__xmlrpc.SendReport(self.GetXMLreport()) - if earlystop: rtevalres = 1 self._sysinfo.copy_dmesg(self.__reportdir)rteval/rtevalConfig.py +0
-1@@ -73,7 +73,6 @@ default_config = { 'workdir' : os.getcwd(), 'installdir' : installdir, 'srcdir' : default_config_search(['loadsource']), - 'xmlrpc' : None, 'xslt_report': default_config_search(['rteval_text.xsl'], os.path.isfile), 'xslt_histogram': default_config_search(['rteval_histogram_raw.xsl'], os.path.isfile), 'report_interval': '600',rteval/rtevalMailer.py deleted +0
-51@@ -1,51 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# -# rtevalmailer.py - module for sending e-mails -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# - -import smtplib -import email - - -class rtevalMailer(object): - "rteval mailer - sends messages via an SMTP server to designated e-mail addresses" - - def __init__(self, cfg): - # this configuration object needs to have the following attributes set: - # * smtp_server - # * from_address - # * to_address - # - errmsg = "" - if 'smtp_server' not in cfg: - errmsg = "\n** Missing smtp_server in config" - if 'from_address' not in cfg: - errmsg += "\n** Missing from_address in config" - if 'to_address' not in cfg: - errmsg += "\n** Missing to_address in config" - - if not errmsg == "": - raise LookupError(errmsg) - - self.config = cfg - - - def __prepare_msg(self, subj, body): - msg = email.MIMEText.MIMEText(body) - msg['subject'] = subj; - msg['From'] = "rteval mailer <" + self.config.from_address+">" - msg['To'] = self.config.to_address - return msg - - - def SendMessage(self, subject, body): - "Sends an e-mail to the configured mail server and recipient" - - msg = self.__prepare_msg(subject, body) - srv = smtplib.SMTP() - srv.connect(self.config.smtp_server) - srv.sendmail(self.config.from_address, self.config.to_address, str(msg)) - srv.close() -rteval/rtevalXMLRPC.py deleted +0
-97@@ -1,97 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# rtevalXMLRPC.py - main rteval XML-RPC class -# -# Copyright 2009 - 2013 Clark Williams <[email protected]> -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# - -import socket -import time -import xmlrpc.client -from .rtevalclient import rtevalclient -from .Log import Log - -class rtevalXMLRPC: - def __init__(self, host, logger, mailer=None): - self.__host = host - self.__url = f"http://{self.__host}/rteval/API1/" - self.__logger = logger - self.__mailer = mailer - self.__client = rtevalclient.rtevalclient(self.__url) - - - def Ping(self): - res = None - self.__logger.log(Log.DEBUG, f"Checking if XML-RPC server '{self.__host}' is reachable") - attempt = 0 - ping_success = False - warning_sent = False - while attempt < 6: - try: - res = self.__client.Hello() - attempt = 10 - ping_success = True - except xmlrpc.client.ProtocolError: - # Server do not support Hello(), but is reachable - self.__logger.log(Log.INFO, f"Got XML-RPC connection with {self.__host} but it did not support Hello()") - res = None - except socket.error as err: - self.__logger.log(Log.INFO, f"Could not establish XML-RPC contact with {self.__host}\n{str(err)}") - - # Do attempts handling - attempt += 1 - if attempt > 5: - break # To avoid sleeping before we abort - - if (self.__mailer is not None) and (not warning_sent): - self.__mailer.SendMessage("[RTEVAL:WARNING] Failed to ping XML-RPC server", f"Server {self.__host} did not respond.") - warning_sent = True - - print(f"Failed pinging XML-RPC server. Doing another attempt({attempt}) ") - time.sleep(attempt) #*15) # Incremental sleep - sleep attempts*15 seconds - ping_success = False - - if res: - self.__logger.log(Log.INFO, f'Verified XML-RPC connection with {res["server"]} (XML-RPC API version: {res["APIversion"]})') - self.__logger.log(Log.DEBUG, f"Recieved greeting: {res['greeting']}") - return ping_success - - - def SendReport(self, xmlreport): - "Sends the report to a given XML-RPC host. Returns 0 on success or 2 on submission failure." - - attempt = 0 - exitcode = 2 # Presume failure - warning_sent = False - while attempt < 6: - try: - print(f"Submitting report to {self.__url}") - rterid = self.__client.SendReport(xmlreport) - print(f"Report registered with submission id {rterid}") - attempt = 10 - exitcode = 0 # Success - except socket.error: - attempt += 1 - if attempt > 5: - break # To avoid sleeping before we abort - - if (self.__mailer is not None) and (not warning_sent): - self.__mailer.SendMessage("[RTEVAL:WARNING] Failed to submit report to XML-RPC server", f"Server {self.__host} did not respond. Not giving up yet.") - warning_sent = True - - print(f"Failed sending report. Making another attempt({attempt}) ") - time.sleep(attempt) #*5*60) # Incremental sleep - sleep attempts*5 minutes - - except Exception as err: - raise err - - - if self.__mailer is not None: - # Send final result messages - if exitcode == 2: - self.__mailer.SendMessage("[RTEVAL:FAILURE] Failed to submit report to XML-RPC server", f"Server {self.__host} did not respond at all after {attempt - 1} attempts.") - elif (exitcode == 0) and warning_sent: - self.__mailer.SendMessage("[RTEVAL:SUCCESS] XML-RPC server available again", - f"Succeeded to submit the report to {self.__host}") - - return exitcoderteval/rtevalclient.py deleted +0
-60@@ -1,60 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# -# rtevalclient.py -# XML-RPC client for sending data to a central rteval result server -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# - -import xmlrpc.client -import libxml2 -import io -import bz2 -import base64 -import platform - -class rtevalclient: - """ - rtevalclient is a library for sending rteval reports to an rteval server via XML-RPC. - """ - def __init__(self, url="http://rtserver.farm.hsv.redhat.com/rteval/API1/", hostn = None): - self.srv = xmlrpc.client.ServerProxy(url) - if hostn is None: - self.hostname = platform.node() - else: - self.hostname = hostn - - def Hello(self): - return self.srv.Hello(self.hostname) - - def DatabaseStatus(self): - return self.srv.DatabaseStatus() - - def SendReport(self, xmldoc): - if xmldoc.type != 'document_xml': - raise Exception("Input is not XML document") - - fbuf = io.StringIO() - xmlbuf = libxml2.createOutputBuffer(fbuf, 'UTF-8') - doclen = xmldoc.saveFileTo(xmlbuf, 'UTF-8') - - compr = bz2.BZ2Compressor(9) - cmpr = compr.compress(fbuf.getvalue()) - data = base64.b64encode(cmpr + compr.flush()) - ret = self.srv.SendReport(self.hostname, data) - print(f"rtevalclient::SendReport() - Sent {len(data)} bytes (XML document length: {doclen} bytes, compression ratio: {(1-(float(len(data)) / float(doclen)))*100}:.2f)") - return ret - - def SendDataAsFile(self, fname, data, decompr = False): - compr = bz2.BZ2Compressor(9) - cmprdata = compr.compress(data) - b64data = base64.b64encode(cmprdata + compr.flush()) - return self.srv.StoreRawFile(self.hostname, fname, b64data, decompr) - - - def SendFile(self, fname, decompr = False): - f = open(fname, "r") - srvname = self.SendDataAsFile(fname, f.read(), decompr) - f.close() - return srvname -server/COPYING deleted +0
-339@@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License.server/INSTALL deleted +0
-302@@ -1,302 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `<wchar.h>' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. -server/Logger.py deleted +0
-19@@ -1,19 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -import sys -from datetime import datetime - -class Logger(): - def __init__(self, logfile, prefix): - self.log = sys.stdout - self.logopen = True - self.prefix = prefix - - def Log(self, grp, msg): - if self.logopen == True: - tstmp = datetime.today().strftime("%Y-%m-%d %H:%M:%S") - self.log.write("%s [%s::%s]: %s\n" % (tstmp, self.prefix, grp, msg)) - self.log.flush() - - def LogFD(self): - return self.log.fileno() -server/Makefile.am deleted +0
-38@@ -1,38 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Makefile.am - autotools configuration file -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# -SUBDIRS = parser -dist_doc_DATA = parser/README.parser \ - sql/delta-1.0_1.1.sql \ - sql/delta-1.1_1.2.sql \ - sql/delta-1.2_1.3.sql \ - sql/delta-1.3_1.4.sql \ - sql/rteval-$(SQLSCHEMAVER).sql - -apache-rteval.conf: -if ENAB_MODPYTHON - [ -n $(XMLRPCROOT) ] && $(srcdir)/gen_config.sh apache-rteval.conf $(XMLRPCROOT)/API1 -else - [ -n $(XMLRPCROOT) ] && $(srcdir)/gen_config.sh apache-rteval-wsgi.conf $(XMLRPCROOT)/API1 -endif - -clean-local: - -rm -f apache-rteval.conf *~ - -dist-hook: - cp $(srcdir)/gen_config.sh $(srcdir)/apache-rteval.conf.tpl $(srcdir)/apache-rteval-wsgi.conf.tpl $(distdir)/ - -rm -f $(distdir)/apache-rteval.conf - -if ENAB_XMLRPC - xmlrpcdir = $(XMLRPCROOT)/API1 - BUILT_SOURCES = apache-rteval.conf - dist_doc_DATA += README.xmlrpc apache-rteval.conf - dist_xmlrpc_DATA = xmlrpc_API1.py rtevaldb.py database.py -if ENAB_MODPYTHON - dist_xmlrpc_DATA += rteval_xmlrpc.py -else - dist_xmlrpc_DATA += rteval_xmlrpc.wsgi -endif -endifserver/README.xmlrpc deleted +0
-201@@ -1,201 +0,0 @@ -** -** Setting up a rteval XML-RPC server -** - -The XML-RPC server has the purpose of collecting information from -several rteval clients. All the data in the summary.xml produced by the -rteval script is sent over to the XML-RPC server and registered in a -submission queue. The XML-RPC server will then send back a submission -ID to the client. - -A parser daemon needs to run as well. This daemon is connected to the -same database as the XML-RPC service and it will wait for new reports in -the submission queue to be parsed. Look into the README.parser file -for more information on setting up the rteval_parserd process. - -Each parsed report will get a unique system ID which then can be used to -track how each system changes behaviour on different kernels. - - -** -** Requirements -** - - Apache web server - - mod_python-3.3.x OR mod_wsgi-3.2 or newer. - - PostgreSQL v8.3 or later - - rteval 1.12 or later - - -** -** Apache preparations -** - -The default path used for the rteval client is - - http://{server hostname}/rteval/API1/ - -If you have a HTTP setup which will follow this scheme, you do not -need to change any URLs at all. - -When installing the rteval-xmlrpc-1.4 RPM on a Fedora/RHEL based box, -Apache will be automatically configured. But the Apache web server -will need to be restarted when you have setup the database. - - # server httpd restart - -For manual installations, see the instructions under "Building and -installing from source" further down in this file. - - -** -** Database preparations -** - -** Setting up a new database -All reports are saved in a database. If you have not used the -rteval-xmlrpc interface before, you need to create the needed database -user and database, execute the following command line: - - # psql < /usr/share/doc/rteval-xmlrpc-1.5/rteval-1.4.sql - -This script will first create a database user called 'rtevxmlrpc' and -'rtevparser', assign default password before creating the database called -'rteval'. The database will be populated with the needed tables and the -'rtevxmlrpc' and 'rtevparser' users will get the needed privileges to do -their job. - -Remember to also update the pg_hba.conf file in the PostgreSQL data -directory. You need to allow the xmlrpc user access from the web -server. - -pg_hba.conf entry example: ------------------------------------------------------------------ -# TYPE DATABASE USER CIDR-ADDRESS METHOD -hostssl rteval rtevxmlrpc 127.0.0.1/32 md5 -hostssl rteval rtevparser 127.0.0.1/32 md5 ------------------------------------------------------------------ - -The XML-RPC database connector will always try to connect via SSL. To -modify the default password, connect to the database with psql and -issue this SQL command: - - rteval=# ALTER USER rtevxmlrpc WITH ENCRYPTED PASSWORD '<newpassword>'; - rteval=# ALTER USER rtevparser WITH ENCRYPTED PASSWORD '<newpassword>'; - -Or you can use the "safe mode" via the psql command: - - rteval=# \password rtevxmlrpc - Enter new password: - Enter it again: - rteval=# \password rtevparser - Enter new password: - Enter it again: - - -** Update an already existing database -If you already have an rteval database setup, you can run the delta -scripts to only do the pure database schema changes. - -To find out which schema version you using, do the following: - - psql rteval -c "SELECT value FROM rteval_info WHERE key='sql_schema_ver'" - value - ------- - 1.1 - (1 row) - -This indicates that the database is at the schema version 1.1. If you do not -have the rteval_info table, you are for sure on schema version 1.0. - -* Update from SQL schema version 1.0 to 1.1 - psql rteval < /usr/share/doc/rteval-xmlrpc-1.1/delta-1.0_1.1.sql - -* Update from SQL schema version 1.1 to 1.2 - psql rteval < /usr/share/doc/rteval-xmlrpc-1.1/delta-1.1_1.2.sql - -* Update from SQL schema version 1.2 to 1.3 - psql rteval < /usr/share/doc/rteval-xmlrpc-1.1/delta-1.2_1.3.sql - -* Update from SQL schema version 1.3 to 1.4 - psql rteval < /usr/share/doc/rteval-xmlrpc-1.1/delta-1.3_1.4.sql - -You need to upgrade to the latest SQL schema available, and you must upgrade -sequentially through all the version in between your version and the latest. - - -** -** Building an installing from source -** - -The rteval-xmlrpc uses autotools to configure and build the -rteval-xmlrpc server and parser. - - ./configure [--with-xmlrpc-webroot=<full path>] - -If the --with-xmlrpc-webroot is not provided, the mod_python files -needed for the XML-RPC server will not be installed, and only the -report parser will be built and installed. - -The path to the --with-xmlrpc-webroot must be a directory which the -Apache web server can access and serve files from (htdocs dir). On -Fedora/RHEL this path should be: - - ./configure --with-xmlrpc-webroot=/var/www/html/rteval - -With this done, you can now do the traditional 'make' and 'make -install'. The default install prefix is /usr/local, unless you -changed it with --prefix=<path>. You will then find the -rteval_parserd installed under /usr/local/bin/rteval_parserd and -README files, the SQL scripts and an Apache config file will be found -under /usr/local/share/doc/rteval-parser-1.5/ - -The Apache configuration file can be copied into the configuration -directory Apache uses for its modules. On RHEL/Fedora based -distributions, the apache-rteval.conf can be copied into -/etc/httpd/conf.d/ - -For more information about the report parser (rteval-parserd), please -have a look at the README.parser file. - - -** -** Configuration -** - -If you are not using any of the default values for -the database configuration, you need to create or modify the -/etc/rteval.conf file. The XML-RPC service will read the -[xmlrpc_server] section in this file. - -This is the default values, if the xmlrpc_server section is not found -or parameters is not set. - - # Paths - datadir: /var/lib/rteval - - # Database parameters - db_server: localhost - db_port: 5432 - database: rteval - db_username: xmlrpc - db_password: rtevaldb - -The directory the datadir parameter points at must be writable to the -apache process. Here copies of the received summary.xml files will be -saved before the rteval-parserd process parses the reports. - - -** -** Testing the setup -** - -For a quick test, dig up a summary.xml file from an earlier rteval run and -try sending it to the XML-RPC server by using the testclient_sendreportfile -script: - - ./testclient_sendreportfile --report=summary.xml \ - --xmlrpc-submit=localhost - -See --help for more info on this utility. Usually the log files of Apache and -PostgreSQL provides pretty good information if something goes wrong. -server/apache-rteval-wsgi.conf.tpl deleted +0
-22@@ -1,22 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# File: apache-rteval.conf -# -# Apache config entry to enable the rteval XML-RPC server -# -# Copyright 2011 - 2013 David Sommerseth <[email protected]> -# - -WSGISocketPrefix /var/run/wsgi -WSGIDaemonProcess rtevalxmlrpc processes=3 threads=15 python-path={_INSTALLDIR_} -WSGIScriptAlias /rteval/API1 {_INSTALLDIR_}/rteval_xmlrpc.wsgi - -<Directory "{_INSTALLDIR_}"> - Options Indexes FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - - WSGIProcessGroup rtevalxmlrpc - WSGICallableObject rtevalXMLRPC_handler -</Directory> -server/apache-rteval.conf.tpl deleted +0
-18@@ -1,18 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# File: apache-rteval.conf -# -# Apache config entry to enable the rteval XML-RPC server -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# -<Directory "{_INSTALLDIR_}"> - Options Indexes FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - - SetHandler python-program - PythonHandler rteval_xmlrpc - PythonDebug On -</Directory> -server/configure.ac deleted +0
-130@@ -1,130 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# configure.ac - autotools configuration file -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# -# -# -# To create the ./configure script you need to run 'autoreconf --install' -# - -AC_INIT([rteval-xmlrpc], [1.6], [[email protected]]) -SQLSCHEMAVER=1.5 -AC_SUBST(SQLSCHEMAVER) - -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_PROG_CC - -AC_ARG_WITH([xmlrpc-webroot], - [AS_HELP_STRING([--with-xmlrpc-webroot], - [Location where to install the XML-RPC mod_python files])], - [XMLRPCROOT="$withval"] -) -AC_SUBST(XMLRPCROOT) -AM_CONDITIONAL([ENAB_XMLRPC], [test ! -z $XMLRPCROOT]) - -AC_ARG_ENABLE([mod-python], - [AS_HELP_STRING([--with-mod-python], - [Enable the older mod_python support instead of mod_wsgi])], - [MODPYTHON="$enableval"] -) -AC_SUBST(MODPYTHON) -AM_CONDITIONAL([ENAB_MODPYTHON], [test ! -z $MODPYTHON]) - -# Simple macro to abort on missing functions in libraries -AC_DEFUN([AX_msgMISSINGFUNC], AC_MSG_ERROR([Could not find function in library. Aborting])) - -# Save original CPPFLAGS -save_CPPFLAGS="$CPPFLAGS" - -# Check for libxml2 -AC_CHECK_PROGS([XML2CFG], [xml2-config], [:]) -if test "$XML2CFG" = :; then - AC_MSG_ERROR([This package needs xml2-config from libxml2]) -else - AC_SUBST([LIBXML2_INC], [$(xml2-config --cflags)]) - CPPFLAGS="$CPPFLAGS $LIBXML2_INC" -fi -AC_CHECK_HEADERS([libxml/tree.h]) -AC_CHECK_HEADERS([libxml/xmlsave.h]) -AC_CHECK_HEADERS([libxml/xmlstring.h]) -AC_CHECK_HEADERS([libxml/parser.h]) -AC_CHECK_LIB([xml2],[xmlInitParser], [], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlCleanupParser], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlStrcmp], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlFreeDoc], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlSaveToBuffer], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlSaveTree], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlSaveClose], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlBufferFree], [DUMMY=], AX_msgMISSINGFUNC) -AC_CHECK_LIB([xml2],[xmlParseFile], [DUMMY=], AX_msgMISSINGFUNC) - -# Check for libxslt -AC_CHECK_PROGS([XSLTCFG], [xslt-config], [:]) -if test "$XSLTCFG" = :; then - AC_MSG_ERROR([This package needs xslt-config from libxslt]) -else - AC_SUBST([LIBXSLT_INC], [$(xslt-config --cflags)]) - CPPFLAGS="$CPPFLAGS $LIBXSLT_INC" - LDFLAGS="$LDFLAGS -lexslt" -fi -AC_CHECK_HEADERS([libxslt/xsltInternals.h]) -AC_CHECK_HEADERS([libxslt/transform.h]) -AC_CHECK_HEADERS([libxslt/xsltutils.h]) -AC_CHECK_LIB([xslt], [xsltInit], [], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([xslt], [xsltCleanupGlobals], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([xslt], [xsltParseStylesheetFile], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([xslt], [xsltApplyStylesheet], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([xslt], [xsltFreeStylesheet], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([exslt], [exsltRegisterAll], [DUMMY=], AX_msgMISSINGFUNC()) - -# Check for libpq -AC_CHECK_PROGS([PGSQLCFG], [pg_config], [:]) -if test "$PGSQLCFG" = :; then - AC_MSG_ERROR([This package needs pg_config from PostgreSQL]) -else - AC_SUBST([LIBPQ_INC], [-I$(pg_config --includedir)]) - CPPFLAGS="$CPPFLAGS $LIBPQ_INC" -fi -AC_CHECK_HEADERS([libpq-fe.h]) -AC_CHECK_LIB([pq], [PQsetdbLogin], [], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQstatus], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQexec], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQreset], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQfinish], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQprepare], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQexecPrepared], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQresultStatus], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQclear], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQconsumeInput], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQnotifies], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pq], [PQntuples], [DUMMY=], AX_msgMISSINGFUNC()) - -# Restore the original CPPFLAGS -CPPFLAGS="$save_CPPFLAGS" - -# Check for POSIX features -AC_CHECK_HEADERS([mq.h]) -AC_CHECK_LIB([rt], [mq_open], [], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([rt], [mq_close], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([rt], [mq_unlink], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([rt], [mq_send], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([rt], [mq_receive], [DUMMY=], AX_msgMISSINGFUNC()) - -AC_CHECK_HEADERS([pthread.h]) -AC_CHECK_LIB([pthread], [pthread_attr_init], [], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pthread], [pthread_attr_setdetachstate], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pthread], [pthread_attr_destroy], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pthread], [pthread_create], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pthread], [pthread_join], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pthread], [pthread_mutex_lock], [DUMMY=], AX_msgMISSINGFUNC()) -AC_CHECK_LIB([pthread], [pthread_mutex_unlock], [DUMMY=], AX_msgMISSINGFUNC()) - -# Back to needed autotools stuff -AC_CONFIG_SRCDIR([parser/rteval-parserd.c]) -AC_CONFIG_HEADERS([parser/config.h]) -AC_CONFIG_FILES([Makefile parser/Makefile]) -AC_SUBST([AM_CXXFLAGS], [$CFLAGS]) -AC_SUBST([AM_LDFLAGS], [$LDFLAGS]) - -AC_OUTPUTserver/database.py deleted +0
-238@@ -1,238 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# -# database.py -# Library for processing results from XMLSQLparser and -# query a PostgreSQL database based on the input data -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# - -import psycopg2 -import types - -class Database(object): - def __init__(self, host=None, port=None, user=None, password=None, database=None, - noaction=False, debug=False): - self.noaction = noaction - self.debug = debug - - dsnd = {} - if host is not None: - dsnd['host'] = host - dsnd['sslmode'] = 'require' - if port is not None: - dsnd['port'] = str(port) - dsnd['sslmode'] = 'require' - if user is not None: - dsnd['user'] = user - if password is not None: - dsnd['password'] = password - if database is not None: - dsnd['dbname'] = database - - dsn = " ".join(["%s='%s'" %(k,v) for (k,v) in list(dsnd.items())]) - self.conn = not self.noaction and psycopg2.connect(dsn) or None - - - def INSERT(self, sqlvars): - # - # Validate input data - # - if type(sqlvars) is not dict: - raise AttributeError('Input parameter is not a Python dict') - - try: - sqlvars['table'] - sqlvars['fields'] - sqlvars['records'] - except KeyError as err: - raise KeyError("Input dictionary do not contain a required element: %s").with_traceback(str(err)) - - if type(sqlvars['fields']) is not list: - raise AttributeError("The 'fields' element is not a list of fields") - - if type(sqlvars['records']) is not list: - raise AttributeError("The 'records' element is not a list of fields") - - if len(sqlvars['records']) == 0: - return True - - try: - sqlvars['returning'] - except: - sqlvars['returning'] = None - - # - # Build SQL template - # - sqlstub = "INSERT INTO %s (%s) VALUES (%s)" % ( - sqlvars['table'], - ",".join(sqlvars['fields']), - ",".join(["%%(%s)s" % f for f in sqlvars['fields']]) - ) - - # Get a database cursor - curs = not self.noaction and self.conn.cursor() or None - - # - # Loop through all records and insert them into the database - # - results = [] - for rec in sqlvars['records']: - if type(rec) is not list: - raise AttributeError("The field values inside the 'records' list must be in a list") - - # Create a dictionary, which will be used for the SQL operation - values = {} - for i in range(0, len(sqlvars['fields'])): - values[sqlvars['fields'][i]] = rec[i] - - if self.debug: - print("SQL QUERY: ==> %s" % (sqlstub % values)) - - # Do the INSERT query - if not self.noaction: - curs.execute(sqlstub, values) - - # If a return value for the INSERT is defined, catch that one - if not self.noaction and sqlvars['returning']: - # The psycopg2 do not handle INSERT INTO ... RETURNING column queries, so we can only use - # this on tables with oid and do the look up that way - vls = {"table": sqlvars['table'], 'colname': sqlvars['returning'], 'oid': str(curs.lastrowid)} - curs.execute("SELECT %(colname)s FROM %(table)s WHERE oid='%(oid)s'" % vls) - results.append(curs.fetchone()[0]) - else: - results.append(True) - - if not self.noaction: - curs.close() - return results - - - def DELETE(self, table, where): - try: - sql = "DELETE FROM %s WHERE %s" % ( - table, - " AND ".join(["%s = %%(%s)s" % (k,k) for (k,v) in list(where.items())]) - ) - - if self.debug: - print("SQL QUERY ==> %s" % (sql % where)) - - if not self.noaction: - curs = self.conn.cursor() - curs.execute(sql, where) - delrows = curs.rowcount - curs.close() - return delrows - else: - return 0 - except Exception as err: - raise Exception("** SQL ERROR ** %s\n** SQL ERROR ** Message: %s" % ((sql % where), str(err))) - - def SELECT(self, table, fields, joins=None, where=None): - curs = not self.noaction and self.conn.cursor() or None - - # Query - try: - sql = "SELECT %s FROM %s %s %s" % ( - ",".join(fields), - table, - joins and "%s" % joins or "", - where and "WHERE %s" % " AND ".join(["%s = %%(%s)s" % (k,k) for (k,v) in list(where.items())] or "") - ) - if self.debug: - print("SQL QUERY: ==> %s" % (sql % where)) - if not self.noaction: - curs.execute(sql, where) - else: - # If no action is setup (mainly for debugging), return empty result set - return {"table": table, "fields": [], "records": []} - except Exception as err: - raise Exception("** SQL ERROR *** %s\n** SQL ERROR ** Message: %s" % (where and (sql % where) or sql, str(err))) - - # Extract field names - fields = [] - for fn in curs.description: - fields.append(fn[0]) - - # Extract records - records = [] - for dbrec in curs.fetchall(): - values = [] - for val in dbrec: - values.append(val) - records.append(values) - - curs.close() - if self.debug: - print("database::SELECT() result ** Fields: %s\nRecords: %s" % (fields, records)) - return {"table": table, "fields": fields, "records": records} - - def COMMIT(self): - # Commit the work - if not self.noaction: - self.conn.commit() - - def ROLLBACK(self): - # Abort / rollback the current work - if not self.noaction: - self.conn.rollback() - - - def GetValue(self, dbres, recidx, field): - "Helper function to easy extract a field from a record set" - - # Check that input data good - if type(dbres) is not dict: - raise AttributeError('Database result parameter is not a Python dict') - - try: - dbres['table'] - dbres['fields'] - dbres['records'] - except KeyError as err: - raise KeyError("Database result parameter do not contain a required element: %s").with_traceback(str(err)) - - if type(dbres['fields']) is not list: - raise AttributeError("The 'fields' element is not a list of fields") - - if type(dbres['records']) is not list: - raise AttributeError("The 'records' element is not a list of fields") - - # Return None when we're going out of boundaries - if recidx >= len(dbres['records']): - return None - - if type(field) == bytes: - # Find the field index of the field name in the records set - try: - fidx = dbres['fields'].index(field) - except ValueError: - raise Exception("Field '%s' is not found in the database result" % field) - elif type(field) == int: - # If the field value is integer, assume it is the numeric field id - if field >= len(dbres['fields']): - raise Exception("Field id '%i' is too high. No field available" % field) - fidx = field - - # Return the value - return dbres['records'][recidx][fidx] - - - def NumTuples(self, dbres): - # Check that input data good - if type(dbres) is not dict: - raise AttributeError('Database result parameter is not a Python dict') - - try: - dbres['table'] - dbres['fields'] - dbres['records'] - except KeyError as err: - raise KeyError("Database result parameter do not contain a required element: %s").with_traceback(str(err)) - - if type(dbres['records']) is not list: - raise AttributeError("The 'records' element is not a list of fields") - - return len(dbres['records'])server/gen_config.sh deleted +0
-14@@ -1,14 +0,0 @@ -#/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later - -APACHECONF="$1" -INSTALLDIR="$2" - -echo "Creating Apache config file: apache-rteval.conf" -escinstpath="$(echo ${INSTALLDIR} | sed -e 's/\//\\\\\//g')" -expr=$(echo "s/{_INSTALLDIR_}/${escinstpath}/") -eval "sed -e ${expr} ${APACHECONF}.tpl" > apache-rteval.conf -echo "Copy the apache apache-rteval.conf into your Apache configuration" -echo "directory and restart your web server" -echo -server/parser/Makefile.am deleted +0
-30@@ -1,30 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Makefile.am - autotools configuration file -# -# Copyright 2009 - 2013 David Sommerseth <[email protected]> -# - -# Generic include files, found by ./configure -AM_CPPFLAGS = $(LIBXML2_INC) $(LIBXSLT_INC) $(LIBPQ_INC) -std=gnu89 - -# What is required to build rteval_parserd -bin_PROGRAMS = rteval-parserd -rteval_parserd_SOURCES = argparser.c argparser.h \ - configparser.c configparser.h \ - eurephia_nullsafe.c eurephia_nullsafe.h eurephia_values_struct.h \ - eurephia_values.c eurephia_values.h \ - eurephia_xml.c eurephia_xml.h \ - log.c log.h \ - parsethread.c parsethread.h threadinfo.h \ - pgsql.c pgsql.h \ - sha1.c sha1.h \ - xmlparser.c xmlparser.h \ - rteval-parserd.c statuses.h - -# Don't build, only install -xsltdir=$(datadir)/rteval -dist_xslt_DATA = xmlparser.xsl - -# Copy init script and config file example to the docs dir -initscriptdir=$(docdir)/initscripts -dist_initscript_DATA = rteval-parserd.init rteval-parserd.sysconfigserver/parser/README.parser deleted +0
-204@@ -1,204 +0,0 @@ -** -** rteval-parsed - the rteval XML report parser -** - -The purpose of the daemon is to off load the web server from the heavy duty -work of parsing and processing the rteval XML reports. The XML-RPC server -will receive the reports and put the files in a queue directory on the -file system and register the the submission in the database. This will notify -the rteval-parsed that a new report has been received and it will start -processing that file independently of the web/XML-RPC server. - - -** Installing the software - - !! Please install also the rteval-xmlrpc package and read the !! - !! README.xmlrpc file also for setting up and preparing the !! - !! database which the rteval-parserd program will be using. !! - !! This file will also contain information regardingupgrading !! - !! the database. !! - -When installing this application from a binary package, like RPM -files on Fedora/RHEL based boxes, you should have the rteval-parserd -in your $PATH. Otherwise, when installing from sources, the configure -script defines the default paths. - - -** Configure rteval-parsed - -When starting the rteval-parserd via the init.d script (or via the 'service' -command on RHEL/Fedora distributions) it will use the values configured in -/etc/sysconfig/rteval-parserd. - -The available parameters are: - - - NUM_THREADS - When this is not defined, the default behaviour is to use the number - of available CPU cores. The init.d script will detect this - automatically. - - - LOG - This defines how logging will be done. See the rteval-parserd - arguments description further down in the document for more - information. - - - LOGLEVEL - Defines how verbose the logging will be. See the rteval-parserd - arguments description further down in the document for more - information. - - - CONFIGFILE - The default configuration file rteval-parserd will try to read is - /etc/rteval.conf. See the next paragraph for more information about - this file. This argument let you override the default config file. - - - PIDFILE - Defines where the init.d script will put the PID file for the - rteval-parserd process. The default is /var/run/rteval-parserd.pid - -This daemon uses the same configuration file as the rest of the rteval program -suite, /etc/rteval.conf. It will parse the section named 'xmlrpc_parser'. - -The default values are: - - - xsltpath: /usr/share/rteval - Defines where it can find the xmlparser.xsl XSLT template - - - db_server: localhost - Which database server to connect to - - - db_port: 5432 - Which port to use for the database connection - - - database: rteval - Which database to make use of. - - - db_username: rtevparser - Which user name to use for the connection - - - db_password: rtevaldb_parser - Which password to use for the authentication - - - reportdir: /var/lib/rteval/report - Where to save the parsed reports - - - threads: 4 - Number of worker threads. This defines how many reports you will - process in parallel. The recommended number here is the number - of available CPU cores, as having a higher thread number often - punishes the performance. The default value is 4 when rteval-parserd - is started directly. When started via the init.d script, the default - is to start one thread per CPU core. - - - max_report_size: 2097152 - Maximum file size of reports which the parser will process. The - default value is 2MB. The value must be given in bytes. Remember - that this value is per thread, and that XML and XSLT processing can - be quite memory hungry. If this value is set too high or you have too - many worker threads, your system might become unresponsive for a while - and the parser might be killed by the kernel (OOM). - - - measurement_tables: cyclic_statistics, cyclic_histogram, hwlatdetect_summary, hwlatdetect_samples - Declares which measurement results will be parsed and stored in the - database. These names are referring to table definitions in the - xmlparser.xsl XSLT template. The definitions in this template tells - rteval-parsed which data to extract from the rteval summary.xml report - and where and how to store it in the database. - - -** rteval-parserd arguments - - -d | --daemon Run as a daemon - -l | --log <log dest> Where to put log data - -L | --log-level <verbosity> What to log - -f | --config <config file> Which configuration file to use - -t | --threads <num. threads> How many worker threads to start (def: 4) - -h | --help This help screen - -- Configuration file -By default the program will look for /etc/rteval.conf. This can be -overridden by using --config <config file>. - -- Logging -When the program is started as a daemon, it will log to syslog by default. -The default log level is 'info'. When not started as a daemon, all logging -will go to stderr by default. - -The --log argument takes either 'destination' or a file name. Unknown -destinations are treated as filenames. Valid 'destinations' are: - - stderr: - Log to stderr - stdout: - Log to stdout - syslog:[facility] - Log to syslog - <file name> - Log to given file - -For syslog the default facility is 'daemon', but can be overridden by using -one of the following facility values: - daemon, user and local0 to local7 - -Log verbosity is set by the --log-level. The valid values here are: - - emerg, emergency - Only log errors which causes the program to stop - alert - Incidents which needs immediate attention - crit, critical - Unexpected incidents which is not urgent - err, error - Parsing errors. Issues with input data - warn, warning - Incidents which may influence performance - notice - Less important warnings - info - General run information - debug - Detailed run information, incl. thread operation - -- Threads -By default, the daemon will use five threads. One for the main threads which -processes the submission queue and notifies the working threads. The four -other threads are worker threads, which will process the received reports. - -Each of the worker threads will have its own connection to the database. This -connection will be connected to the database as long as the daemon is running. -It is therefore important that you do not have more worker threads than -available database connections. - - -** POSIX Message Queue - -The daemon makes use of POSIX MQ for distributing work to the worker threads. -Each thread lives independently and polls the queue regularly for more work. -As the POSIX MQ has a pretty safe mechanism of not duplicating messages in the -implementation, no other locking facility is needed. - -On Linux, the default value for maximum messages in the queue are set to 10. -If you receive a lot of reports and the threads do not process the queue -quickly enough, it will fill up pretty quickly. If the queue is filled up, -the main thread which populates the message queue will politely go to sleep -for one minute before attempting to send new messages. To avoid this, consider -to increase the queue size by modifying /proc/sys/fs/mqueue/msg_max. - -When the daemon initialises itself, it will read this file to make sure it -uses the queue to the maximum, but not beyond that. - - -** PostgreSQL features - -The daemon depends on the PostgreSQL database. It is written with an -abstraction layer so it should, in theory, be possible to easily adopt it to -different database implementation. - -In the current implementation, it makes use of PostgreSQL's LISTEN, NOTIFY and -UNLISTEN features. A trigger is enabled on the submission queue table, which -sends a NOTIFY whenever a record is inserted into the table. The rteval-parser -daemon listens for these notifications, and will immediately poll the table -upon such a notification. - -Whenever a notification is received, it will always parse all unprocessed -reports. In addition it will also only listen for notifications when there -are no unprocessed reports. - -The core PostgreSQL implementation is only done in pgsql.[ch], which provides an -abstract API layer for the rest of the parser daemon. - - -** Submission queue status codes - -In the rteval database's submissionqueue table there is a status field. The -daemon will only consider records with status == 0 for processing. It do not -consider any other fields. For a better understanding of the different status -codes, look into the file statuses.h.server/parser/argparser.c deleted +0
-140@@ -1,140 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* -* Copyright (C) 2009 Red Hat Inc. -* -*/ - -/** -* @file argparser.c -* @author David Sommerseth <[email protected]> -* @date Thu Oct 22 13:58:46 2009 -* -* @brief Generic argument parser -* -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <getopt.h> -#include <eurephia_values.h> -#include <eurephia_nullsafe.h> - - -/** -* Print a help screen to stdout -*/ -void usage () { -printf ("rteval-parserd: Parses new reports recieved via XML-RPC\n" -"\n" -"This program will wait for changes to the rteval 'submissionqueue' table.\n" -"When a new report is registered here, it will send this report to one of\n" -"the worker threads which will insert the parsed result into the database.\n" -"\n" -"** Program arguments:\n" -" -d | --daemon Run as a daemon\n" -" -l | --log <log dest> Where to put log data\n" -" -L | --log-level <verbosity> What to log\n" -" -f | --config <config file> Which configuration file to use\n" -" -t | --threads <num. threads> How many worker threads to start (def: 4)\n" -" -h | --help This help screen\n" -"\n" -"** Configuration file\n" -"By default the program will look for /etc/rteval.conf. This can be\n" -"overriden by using --config <config file>.\n" -"\n" -"** Logging\n" -"When the program is started as a daemon, it will log to syslog by default.\n" -"The default log level is 'info'. When not started as a daemon, all logging\n" -"will go to stderr by default.\n" -"\n" -"The --log argument takes either 'destination' or a file name. Unknown\n" -"destinations are treated as filenames. Valid 'destinations' are:\n" -"\n" -" stderr: - Log to stderr\n" -" stdout: - Log to stdout\n" -" syslog:[facility] - Log to syslog\n" -" <file name> - Log to given file\n" -"\n" -"For syslog the default facility is 'daemon', but can be overriden by using\n" -"one of the following facility values:\n" -" daemon, user and local0 to local7\n" -"\n" -"Log verbosity is set by the --log-level. The valid values here are:\n" -"\n" -" emerg, emergency - Only log errors which causes the program to stop\n" -" alert - Incidents which needs immediate attention\n" -" crit, critical - Unexpected incidents which is not urgent\n" -" err, error - Parsing errors. Issues with input data\n" -" warn, warning - Incidents which may influence performance\n" -" notice - Less important warnings\n" -" info - General run information\n" -" debug - Detailed run information, incl. thread operations\n" -"\n" - ); -} - - -/** -* Parses program arguments and puts the recognised arguments into an eurephiaVALUES struct. -* -* @param argc argument counter -* @param argv argument string table -* -* @return Returns a pointer to an eurephiaVALUES struct. On failure, the program halts. -*/ -eurephiaVALUES *parse_arguments (int argc,char **argv) { -eurephiaVALUES *args =NULL ; -int optidx, c; -static struct option long_opts[] = { - {"log" ,1 ,0 ,'l' }, - {"log-level" ,1 ,0 ,'L' }, - {"config" ,1 ,0 ,'f' }, - {"threads" ,1 ,0 ,'t' }, - {"daemon" ,0 ,0 ,'d' }, - {"help" ,0 ,0 ,'h' }, - {0 ,0 ,0 ,0 } - }; - - args =eCreate_value_space (NULL ,21 ); -eAdd_value (args,"daemon" ,"0" ); -eAdd_value (args,"configfile" ,"/etc/rteval.conf" ); -eAdd_value (args,"threads" ,"4" ); - -while (1 ) { - optidx =0 ; - c =getopt_long (argc, argv,"l:L:f:t:dh" , long_opts, &optidx); -if ( c ==-1 ) { -break ; - } - -switch ( c ) { -case 'l' : -eUpdate_value (args,"log" , optarg,1 ); -break ; -case 'L' : -eUpdate_value (args,"loglevel" , optarg,1 ); -break ; -case 'f' : -eUpdate_value (args,"configfile" , optarg,0 ); -break ; -case 't' : -eUpdate_value (args,"threads" , optarg,0 ); -break ; -case 'd' : -eUpdate_value (args,"daemon" ,"1" ,0 ); -break ; -case 'h' : -usage (); -exit (0 ); - } - } - -// If logging is not configured, and it is not run as a daemon -// -> log to stderr: -if ( (eGet_value (args,"log" ) ==NULL ) - && (atoi_nullsafe (eGet_value (args,"daemon" )) ==0 ) ) { -eAdd_value (args,"log" ,"stderr:" ); - } - -return args; -}server/parser/argparser.h deleted +0
-21@@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* Copyright (C) 2009 Red Hat Inc. -* -*/ - -/** -* @file argparser.h -* @author David Sommerseth <[email protected]> -* @date Thu Oct 22 13:58:46 2009 -* -* @brief Generic argument parser -* -*/ - -#ifndef _RTEVAL_ARGPARSER_h -#define _RTEVAL_ARGPARSER_h - -eurephiaVALUES *parse_arguments (int argc,char **argv); - -#endif server/parser/configparser.c deleted +0
-171@@ -1,171 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* configparser.c - Read and parse config files -* -* This code is based on the fragments from the eurephia project. -* -* GPLv2 Copyright (C) 2009 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file configparser.c -* @author David Sommerseth <[email protected]> -* @date 2009-10-01 -* -* @brief Config file parser -* -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> -#include <assert.h> - -#include <eurephia_nullsafe.h> -#include <eurephia_values.h> -#include <configparser.h> -#include <log.h> - -/** -* Parse one single configuration line into a eurephiaVALUES key/value pair. It will also ignore -* comment lines, and also remove the comments on the line of the configuration line so that only -* the key/value information is extracted. -* -* @param line Input configuration line -* -* @return eurephiaVALUES pointer containing the parsed result. On error or if no valid config -* line was found, NULL is returned. -*/ -static inline eurephiaVALUES *parse_config_line (LogContext *log,const char *line) { -char *cp =NULL , *key =NULL , *val =NULL , *ptr =NULL ;; -eurephiaVALUES *ret =NULL ; - -if ( *line =='#' ) { -return NULL ; - } - - cp =strdup (line); - key = cp; - val =strpbrk (cp,"=:" ); -if ( val ==NULL ) { -free_nullsafe (cp); -return NULL ; - } - *val ='\0' ; val++; - -// Discard comments at the end of a line -if ( (ptr =strpbrk (val,"#" )) !=NULL ) { - *ptr ='\0' ; - } - -// Left trim -while ( ((*key ==0x20 ) || (*key ==0x0A ) || (*key ==0x0D )) ) { - key++; - } -while ( ((*val ==0x20 ) || (*val ==0x0A ) || (*val ==0x0D )) ) { - val++; - } - -// Right trim - ptr = key +strlen_nullsafe (key) -1 ; -while ( ((*ptr ==0x20 ) || (*ptr ==0x0A ) || (*ptr ==0x0D )) && (ptr > key) ) { - ptr--; - } - ptr++; - *ptr ='\0' ; - - ptr = val +strlen_nullsafe (val) -1 ; -while ( ((*ptr ==0x20 ) || (*ptr ==0x0A ) || (*ptr ==0x0D )) && (ptr > val) ) { - ptr--; - } - ptr++; - *ptr ='\0' ; - -// Put key/value into a eurephiaVALUES struct and return it - ret =eCreate_value_space (log,20 ); - ret->key =strdup (key); - ret->val =strdup (val); - -free_nullsafe (cp); -return ret; -} - - -static inline eurephiaVALUES *default_cfg_values (LogContext *log,eurephiaVALUES *prgargs) { -eurephiaVALUES *cfg =NULL , *ptr =NULL ; - - cfg =eCreate_value_space (log,20 ); -eAdd_value (cfg,"datadir" ,"/var/lib/rteval" ); -eAdd_value (cfg,"xsltpath" ,"/usr/share/rteval" ); -eAdd_value (cfg,"db_server" ,"localhost" ); -eAdd_value (cfg,"db_port" ,"5432" ); -eAdd_value (cfg,"database" ,"rteval" ); -eAdd_value (cfg,"db_username" ,"rtevparser" ); -eAdd_value (cfg,"db_password" ,"rtevaldb_parser" ); -eAdd_value (cfg,"reportdir" ,"/var/lib/rteval/reports" ); -eAdd_value (cfg,"max_report_size" ,"2097152" );// 2MB -eAdd_value (cfg,"measurement_tables" ,"cyclic_statistics, cyclic_histogram, hwlatdetect_summary, hwlatdetect_samples" ); - -// Copy over the arguments to the config, update existing settings -for ( ptr = prgargs; ptr; ptr = ptr->next ) { -eUpdate_value (cfg, ptr->key, ptr->val,1 ); - } - -return cfg; -} - -/** -* Parses a section of a config file and puts it into an eurephiaVALUES key/value stack -* -* @param log Initialised log context -* @param prgargs Parsed command line arguments (see parse_arguments()) -* @param section Section to read from the config file -* -* @return Returns a pointer to an eurephiaVALUES stack containing the configuration on success, -* otherwise NULL. -*/ -eurephiaVALUES *read_config (LogContext *log,eurephiaVALUES *prgargs,const char *section) { -FILE *fp =NULL ; -char *buf =NULL , *sectmatch =NULL , *cfgname =NULL ; -int sectfound =0 ; -eurephiaVALUES *cfg =NULL ; -struct stat fi; - - cfgname =eGet_value (prgargs,"configfile" ); -if (stat (cfgname, &fi) ==-1 ) { -writelog (log,LOG_EMERG ,"Could not open the config file: %s" , cfgname); -return NULL ; - } - -if ( (fp =fopen (cfgname,"r" )) ==NULL ) { -writelog (log,LOG_EMERG ,"Could not open the config file: %s" , cfgname); -return NULL ; - } - - buf = (char *)malloc_nullsafe (log, fi.st_size+2 ); - sectmatch = (char *)malloc_nullsafe (log,strlen_nullsafe (section)+4 ); -sprintf (sectmatch,"[%s]" , section); - - cfg =default_cfg_values (log, prgargs); -writelog (log,LOG_DEBUG ,"Reading config file: %s" , cfgname); -while (fgets (buf, fi.st_size, fp) !=NULL ) { -if (strncmp (buf,"[" ,1 ) ==0 ) { - sectfound = (!sectfound && (strncmp (buf, sectmatch,strlen (sectmatch)) ==0 )); -continue ; - } - -if ( sectfound ) { -eurephiaVALUES *prm =parse_config_line (log, buf); -if ( prm !=NULL ) { - cfg =eUpdate_valuestruct (cfg, prm,1 ); - } - } - }; -free_nullsafe (buf); -free_nullsafe (sectmatch); -fclose (fp); fp =NULL ; - -return cfg; -}server/parser/configparser.h deleted +0
-25@@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* configparser.h - Read and parse config files -* -* This code is based on the fragments from the eurephia project. -* -* GPLv2 Copyright (C) 2009 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file configparser.h -* @author David Sommerseth <[email protected]> -* @date 2009-10-01 -* -* @brief Config file parser -* -*/ - -#ifndef _CONFIGPARSER_H -#define _CONFIGPARSER_H - -eurephiaVALUES *read_config (LogContext *log,eurephiaVALUES *prgargs,const char *section); - -#endif server/parser/eurephia_nullsafe.c deleted +0
-54@@ -1,54 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* eurephia_nullsafe.c -* -* standard C string functions, which is made NULL safe by checking -* if input value is NULL before performing the action. -* -* This version is modified to work outside the eurephia project. -* -* GPLv2 only - Copyright (C) 2009 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_nullsafe.c -* @author David Sommerseth <[email protected]> -* @date 2009-09-07 -* -* @brief standard C string functions, which is made NULL safe by checking -* if input value is NULL before performing the action. -* -*/ - -#include <stdio.h> -#include <stdlib.h> - -#include <log.h> - -#if __GNUC__ >=3 -#define __malloc__ __attribute__((malloc)) -#else /* If not GCC 3 or newer, disable optimisations */ -#define __malloc__ -#endif - -/** -* This replaces the use of malloc() and memset(). This function uses calloc -* internally, which results in the memory region being zero'd by the kernel -* on memory allocation. -* -* @param log Log context -* @param sz size of the memory region being allocated -* -* @return Returns a void pointer to the memory region on success, otherwise NULL -*/ -__malloc__ void *malloc_nullsafe(LogContext *log, size_t sz) { -void *buf =NULL ; - - buf =calloc (1 , sz);/* Using calloc, also gives a zero'd memory region */ -if ( !buf ) { -writelog (log,LOG_EMERG ,"Could not allocate memory region for %ld bytes" , sz); -exit (9 ); - } -return buf; -}server/parser/eurephia_nullsafe.h deleted +0
-103@@ -1,103 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* eurephia_nullsafe.h -* -* standard C string functions, which is made NULL safe by checking -* if input value is NULL before performing the action. -* -* This version is modified to work outside the eurephia project. -* -* GPLv2 only - Copyright (C) 2008, 2009 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_nullsafe.h -* @author David Sommerseth <[email protected]> -* @date 2008-08-06 -* -* @brief standard C string functions, which is made NULL safe by checking -* if input value is NULL before performing the action. -* -*/ - -#ifndef EUREPHIA_NULLSAFE_H_ -#define EUREPHIA_NULLSAFE_H_ - -#include <log.h> - -/** -* atoi() wrapper. Converts any string into a integer -* -* @param str Input string -* -* @return Returns integer -*/ -#define atoi_nullsafe (str) (str != NULL ? atoi(str) : 0) - - -/** -* strdup() wrapper. Duplicates the input string. -* -* @param str Input string to be duplicated -* -* @return Returns a pointer to the duplicate (char *) on success, NULL otherwise. -* If input was NULL, NULL is returned. -*/ -#define strdup_nullsafe (str) (str != NULL ? strdup(str) : NULL) - - -/** -* Wrapper macro, which appends a string to a destination string without exceeding the size -* of the destination buffer. -* -* @param dest Pointer to the destination buffer -* @param src Pointer to the value being concatenated to the destination string. -* @param size Size of the destination buffer -*/ -#define append_str (dest, src, size) strncat(dest, src, (size - strlen_nullsafe(dest))) - - -/** -* strlen() wrapper. Returns the length of a string -* -* @param str Input string -* -* @return Returns int with length of string. If input is NULL, it returns 0. -*/ -#define strlen_nullsafe (str) (str != NULL ? strlen(str) : 0) - - -void *malloc_nullsafe (LogContext *,size_t ); - -/** -* Null safe free(). It will not attempt to free a pointer which is NULL. -* -* @param ptr Pointer to the memory region being freed. -* -*/ -#define free_nullsafe (ptr) if( ptr ) { free(ptr); ptr = NULL; } - - -/** -* Function which will return a default string value if no input data was provided. -* -* @param str Input string -* @param defstr Default string -* -* @return Returns the pointer to the input string if the string length > 0. Otherwise it -* will return a pointer to the default string. -*/ -#define defaultValue (str, defstr) (strlen_nullsafe(str) == 0 ? defstr : str) - - -/** -* Function which will return a default integer value if no input data was provided. -* -* @param ival input integer value -* @param defval default integer value -* -* @return Returns the ival value if it is > 0, otherwise defval value is returned. -*/ -#define defaultIntValue (ival, defval) (ival == 0 ? defval : ival) -#endif /* !EUREPHIA_NULLSAFE_H_ */ server/parser/eurephia_values.c deleted +0
-301@@ -1,301 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* eurephia_values.c -- Generic interface for processing key->value pairs -* -* This version is modified to work outside the eurephia project. -* -* GPLv2 only - Copyright (C) 2008 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_values.c -* @author David Sommerseth <[email protected]> -* @date 2008-08-06 -* -* @brief Generic interface for handling key->value pairs -* -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> - -#include <eurephia_nullsafe.h> -#include <eurephia_values_struct.h> - - - -/** -* Function for freeing up an eurephiaVALUES stack. This function is normally not called -* directly, but usually via the eFree_values(...) macro. -* -* @param vls Pointer to a eurephiaVALUES stack to be freed. -*/ -void eFree_values_func (eurephiaVALUES *vls) { -eurephiaVALUES *ptr =NULL , *ptr_next =NULL ; - - ptr = vls; -while ( ptr ) { -free_nullsafe (ptr->key); -free_nullsafe (ptr->val); - - ptr_next = ptr->next; -free_nullsafe (ptr); - ptr = ptr_next; - } -} - - -/** -* Retrieve an eurephiaVALUES element for a given value key -* -* @param vls Pointer to the eurephiaVALUES stack where to search for the element -* @param key String containing the key name of the value requested. -* -* @return Returns an eurephiaVALUES element on success, otherwise NULL. -*/ -eurephiaVALUES *eGet_valuestruct (eurephiaVALUES *vls,const char *key) -{ -eurephiaVALUES *ptr =NULL ; - -if ( (vls ==NULL ) || (key ==NULL ) ) { -return NULL ; - } - - ptr = vls; -while ( ptr !=NULL ) { -if ( (ptr->key !=NULL ) && (strcmp (key, ptr->key) ==0 ) ) { -return ptr; - } - ptr = ptr->next; - } -return NULL ; -} - - -/** -* Retrieves the value of a given key from an eurephiaVALUES stack. -* -* @param vls Pointer to an eurephiaVALUES stack where to search for the value -* @param key String containing the key name of the value requested -* -* @return Returns a string (char *) with the requested value if found, otherwise NULL. -*/ -char *eGet_value (eurephiaVALUES *vls,const char *key) -{ -eurephiaVALUES *ptr =NULL ; - - ptr =eGet_valuestruct (vls, key); -return (ptr !=NULL ? ptr->val :NULL ); -} - - -/** -* Creates a new eurephiaVALUES stack -* -* @param log Log context -* @param evgid int value, giving the stack an ID number. Useful when looking through log files later on. -* -* @return Returns an empty eurephiaVALUES struct on success, otherwise NULL. -*/ -eurephiaVALUES *eCreate_value_space (LogContext *log,int evgid) -{ -eurephiaVALUES *ptr =NULL ; - - ptr = (eurephiaVALUES *)malloc_nullsafe (log,sizeof (eurephiaVALUES) +2 ); - ptr->log = log; - ptr->evgid = evgid; -return ptr; -} - - -/** -* Adds a new eurephiaVALUES stack to another eurephiaVALUES stack. If the evgid value differs, it will -* be overwritten with the value of the destination stack. -* -* @param vls Destination eurephiaVALUES stack -* @param newval Source eurephiaVALUES stack -*/ -void eAdd_valuestruct (eurephiaVALUES *vls,eurephiaVALUES *newval) { -eurephiaVALUES *ptr =NULL ; -int vid =0 ; - -assert (vls !=NULL ); - -if ( (vls->key ==NULL ) && (vls->val ==NULL ) && (vls->next ==NULL ) && (vls->evid ==0 )) { -// Update header record if it is empty, by copying newval record. Free newval afterwards - vls->key =strdup (newval->key); - vls->val =strdup (newval->val); - vls->evid =0 ; - vls->next =NULL ; -eFree_values_func (newval); - }else { -// Add values to the value chain, loop to the end and append it - ptr = vls; -while ( ptr->next !=NULL ) { - ptr = ptr->next; - vid = (vid > ptr->evid ? vid : ptr->evid); - } - newval->evid = vid+1 ;// Increase the value counter - newval->evgid = ptr->evgid; - ptr->next = newval; - } -} - - -/** -* Adds a new key/value pair to an eurephiaVALUES stack -* -* @param vls Destination eurephiaVALUES stack -* @param key Key name for the value being stored -* @param val Value to be stored -*/ -void eAdd_value (eurephiaVALUES *vls,const char *key,const char *val) -{ -eurephiaVALUES *ptr =NULL ; - -assert (vls !=NULL ); - -// Allocate buffer and save values - ptr =eCreate_value_space (vls->log, vls->evid); -if ( ptr ==NULL ) { -writelog (vls->log,LOG_EMERG ,"Failed to add value to the value chain" ); -exit (9 ); - } - ptr->key =strdup_nullsafe (key); - ptr->val =strdup_nullsafe (val); - ptr->evgid = vls->evgid; - -// Add value struct to the chain -eAdd_valuestruct (vls, ptr); -} - - -/** -* Updates the value of a key in a values stack -* -* @param vls eurephiaVALUES key/value stack to update -* @param key String with key name to update -* @param newval String with the new value -* @param addunkn Add unknown keys. If set to 1, if the key is not found it will add a new key -*/ -void eUpdate_value (eurephiaVALUES *vls,const char *key,const char *newval,const int addunkn) { -eurephiaVALUES *ptr =NULL ; - -assert ( (vls !=NULL ) && (key !=NULL ) ); - - ptr =eGet_valuestruct (vls, key); -if ( ptr ) { -free_nullsafe (ptr->val); - ptr->val =strdup_nullsafe (newval); - }else if ( addunkn ==1 ) { -eAdd_value (vls, key, newval); - } -} - - -/** -* Updates a value struct element based on another value struct element contents (key/value) -* -* @param vls eurephiaVALUES key/value stack to update -* @param newval eurephiaVALUES element with the new value -* @param addunkn Add unknown keys. If set to 1, if the key is not found it will add a new key -* -* @return Returns a pointer to the first element in the chain. If the element being updated -* was the first element in the old chain, the first element will be a new element with a -* new address. -*/ -eurephiaVALUES *eUpdate_valuestruct (eurephiaVALUES *vls,eurephiaVALUES *newval,const int addunkn) { -eurephiaVALUES *ptr =NULL , *prevptr =NULL ; - -assert ( (vls !=NULL ) && (newval !=NULL ) && (newval->key !=NULL ) ); - - prevptr = vls; -for ( ptr = vls; ptr !=NULL ; ptr = ptr->next ) { -if ( (ptr->key !=NULL ) && (strcmp (newval->key, ptr->key) ==0 ) ) { - newval->evgid = ptr->evgid; - newval->evid = ptr->evid; - newval->next = ptr->next; - ptr->next =NULL ; -if ( ptr == vls ) { -// If the element found is the first one, do special treatment -eFree_values_func (ptr); -return newval; - }else { - prevptr->next = newval; -eFree_values_func (ptr); -return vls; - } - } - prevptr = ptr; - } - -if ( addunkn ==1 ) { -eAdd_valuestruct (vls, newval); - } -return vls; -} - - -/** -* Removes the key/value pair identified by evgid and evid from the given eurephiaVALUES chain -* -* @param vls Pointer to an eurephiaVALUES chain with the data -* @param evgid Group ID of the chain -* @param evid Element ID of the chain element to be removed -* -* @return Returns a pointer to the chain. The pointer is only changed if the first element in the -* chain is deleted -*/ -eurephiaVALUES *eRemove_value (eurephiaVALUES *vls,unsigned int evgid,unsigned int evid) { -eurephiaVALUES *ptr =NULL , *prev_ptr =NULL ; -int found =0 ; - -// Find the value element -for ( ptr = vls; ptr !=NULL ; ptr = ptr->next ) { -if ( (ptr->evgid == evgid) && (ptr->evid == evid) ) { - found =1 ; -break ; - } - prev_ptr = ptr; - } - -if ( !found ) { -return vls; - } - -if ( ptr != vls ) { - prev_ptr->next = ptr->next; - ptr->next =NULL ; -eFree_values_func (ptr); -return vls; - }else { - prev_ptr = ptr->next; - ptr->next =NULL ; -eFree_values_func (ptr); -return prev_ptr; - } -} - - -/** -* Counts number of elements in an eurephiaVALUES chain. -* -* @param vls eurephiaVALUES pointer to be counted -* -* @return Returns number of elements found. -*/ -unsigned int eCount (eurephiaVALUES *vls) { -eurephiaVALUES *ptr =NULL ; -unsigned int c =0 ; - -if ( vls ==NULL ) { -return 0 ; - } -for (ptr = vls; ptr !=NULL ; ptr = ptr->next ) { - c++; - } -return c; -}server/parser/eurephia_values.h deleted +0
-48@@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* eurephia_values.h -- Generic interface for processing key->value pairs -* -* This version is modified to work outside the eurephia project. -* -* GPLv2 only - Copyright (C) 2008 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_values.h -* @author David Sommerseth <[email protected]> -* @date 2008-08-06 -* -* @brief Generic interface for handling key->value pairs -* -*/ - -#include <eurephia_values_struct.h> - -#ifndef EUREPHIA_VALUES_H_ -#define EUREPHIA_VALUES_H_ - - -eurephiaVALUES *eGet_valuestruct (eurephiaVALUES *vls,const char *key); -char *eGet_value (eurephiaVALUES *vls,const char *key); - -eurephiaVALUES *eCreate_value_space (LogContext *log,int evid); - -void eAdd_valuestruct (eurephiaVALUES *vls,eurephiaVALUES *newval); -void eAdd_value (eurephiaVALUES *vls,const char *key,const char *val); -void eUpdate_value (eurephiaVALUES *vls,const char *key,const char *newval,const int addunkn); -eurephiaVALUES *eUpdate_valuestruct (eurephiaVALUES *vls,eurephiaVALUES *newval,const int addunkn); -eurephiaVALUES *eRemove_value (eurephiaVALUES *vls,unsigned int evgid,unsigned int evid); -unsigned int eCount (eurephiaVALUES *vls); - -/** -* Front-end function for eFree_values_func(). Frees eurephiaVALUES pointer chain and -* sets the pointer to NULL. -* -* @param v eurephiaVALUES pointer which is being freed. -* -*/ -#define eFree_values (v) { eFree_values_func(v); v = NULL; } -void eFree_values_func (eurephiaVALUES *vls); - -#endif /* !EUREPHIA_VALUES_H_ */ server/parser/eurephia_values_struct.h deleted +0
-38@@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* eurephia_values.h -- eurephiaVALUES struct typedef -* -* GPLv2 only - Copyright (C) 2008 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_values_struct.h -* @author David Sommerseth <[email protected]> -* @date 2008-11-05 -* -* @brief Definition of the eurephiaVALUES struct -* -*/ - -#ifndef EUREPHIA_VALUES_STRUCT_H_ -# define EUREPHIA_VALUES_STRUCT_H_ - -#include <log.h> - -/** -* eurephiaVALUES is a pointer chain with key/value pairs. If having several -* such pointer chains, they can be given different group IDs to separate them, -* which is especially useful during debugging. -* -*/ -typedef struct __eurephiaVALUES { -LogContext *log;/**< Pointer to an established log context, used for logging */ -unsigned int evgid;/**< Group ID, all elements in the same chain should have the same value */ -unsigned int evid;/**< Unique ID per element in a pointer chain */ -char *key;/**< The key name of a value */ -char *val;/**< The value itself */ -struct __eurephiaVALUES *next;/**< Pointer to the next element in the chain. NULL == end of chain */ -}eurephiaVALUES ; - -#endif /* !EUREPHIA_VALUES_STRUCT_H_ */ server/parser/eurephia_xml.c deleted +0
-147@@ -1,147 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* eurephia_xml.c -- Generic helper functions for XML parsing -* -* This version is modified to work outside the eurephia project. -* -* GPLv2 only - Copyright (C) 2008, 2009 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_xml.c -* @author David Sommerseth <[email protected]> -* @date 2008-12-15 -* -* @brief Generic XML parser functions -* -* -*/ - -#include <stdarg.h> -#include <string.h> -#include <assert.h> - -#include <libxml/tree.h> -#include <libxml/xmlsave.h> -#include <libxml/xmlstring.h> - -#include <eurephia_nullsafe.h> - - -/** -* Retrieves a given XML node attribute/property -* -* @param attr xmlAttr pointer from an xmlNode pointer. -* @param key The attribute name to search for -* -* @return The value of the found attribute. If not found, NULL is returned. -*/ -char *xmlGetAttrValue (xmlAttr *attr,const char *key) { -xmlAttr *aptr; -xmlChar *x_key =NULL ; - - x_key =xmlCharStrdup (key); -assert ( x_key !=NULL ); - -for ( aptr = attr; aptr !=NULL ; aptr = aptr->next ) { -if (xmlStrcmp (aptr->name, x_key) ==0 ) { -free_nullsafe (x_key); -return (char *)(aptr->children !=NULL ? aptr->children->content :NULL ); - } - } -free_nullsafe (x_key); -return NULL ; -} - - -/** -* Loops through a xmlNode chain to look for a given tag. The search is not recursive. -* -* @param node xmlNode pointer where to look -* @param key the name of the XML tag to find -* -* @return xmlNode pointer to the found xmlNode. NULL is returned if not found. -*/ -xmlNode *xmlFindNode (xmlNode *node,const char *key) { -xmlNode *nptr =NULL ; -xmlChar *x_key =NULL ; - -if ( (node ==NULL ) || (node->children ==NULL ) ) { -return NULL ; - } - - x_key =xmlCharStrdup (key); -assert ( x_key !=NULL ); - -for ( nptr = node->children; nptr !=NULL ; nptr = nptr->next ) { -if (xmlStrcmp (nptr->name, x_key) ==0 ) { -free_nullsafe (x_key); -return nptr; - } - } -free_nullsafe (x_key); -return NULL ; -} - - -/** -* Return the text content of a given xmlNode -* -* @param n xmlNode to extract the value from. -* -* @return returns a char pointer with the text contents of an xmlNode. -*/ -inline char *xmlExtractContent (xmlNode *n) { -return (char *) (((n !=NULL ) && (n->children !=NULL )) ? n->children->content :NULL ); -} - - -/** -* Get the text contents of a given xmlNode -* -* @param node An xmlNode pointer where to look for the contents -* @param key Name of the tag to retrieve the content of. -* -* @return Returns a string with the text content, if the node is found. Otherwise, NULL is returned. -*/ -inline char *xmlGetNodeContent (xmlNode *node,const char *key) { -return xmlExtractContent (xmlFindNode (node, key)); -} - - -/** -* Serialises an xmlNode to a string -* -* @param log Log context -* @param node Input XML node to be serialised -* -* @return Returns a pointer to a new buffer containing the serialised data. This buffer must be freed -* after usage -*/ -char *xmlNodeToString (LogContext *log,xmlNode *node) { -xmlBuffer *buf =NULL ; -xmlSaveCtxt *serctx =NULL ; -char *ret =NULL ; - -if ( node ==NULL ) { -writelog (log,LOG_ALERT ,"xmlNodeToString: Input data is NULL" ); -return NULL ; - } - - buf =xmlBufferCreate (); -assert ( buf !=NULL ); - - serctx =xmlSaveToBuffer (buf,"UTF-8" ,XML_SAVE_NO_EMPTY |XML_SAVE_NO_DECL ); -assert ( serctx !=NULL ); - -if (xmlSaveTree (serctx, node) <0 ) { -writelog (log,LOG_ALERT ,"xmlNodeToString: Failed to serialise xmlNode" ); -return NULL ; - } -xmlSaveClose (serctx); - - ret =strdup_nullsafe ((char *)xmlBufferContent (buf)); -xmlBufferFree (buf); -return ret; -}server/parser/eurephia_xml.h deleted +0
-43@@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* eurephia_xml.h -- Generic helper functions for XML parsing -* -* This version is modified to work outside the eurephia project. -* -* GPLv2 only - Copyright (C) 2008 -* David Sommerseth <[email protected]> -* -*/ - -/** -* @file eurephia_xml.h -* @author David Sommerseth <[email protected]> -* @date 2008-12-15 -* -* @brief Generic XML parser functions -* -*/ - - -#ifndef EUREPHIA_XML_H_ -#define EUREPHIA_XML_H_ - -#include <stdarg.h> - -#include <libxml/tree.h> - -/** -* Simple iterator macro for iterating xmlNode pointers -* -* @param start Pointer to an xmlNode where to start iterating -* @param itn An xmlNode pointer which will be used for the iteration. -*/ -#define foreach_xmlnode (start, itn) for( itn = start; itn != NULL; itn = itn->next ) - -char *xmlGetAttrValue (xmlAttr *properties,const char *key);Lines of this file are not shown. View the raw message.
server/parser/rteval-parserd.c deleted +0
-533Lines of this file are not shown. View the raw message.
server/parser/rteval-parserd.init deleted +0
-126Lines of this file are not shown. View the raw message.
server/parser/rteval-parserd.sysconfig deleted +0
-23Lines of this file are not shown. View the raw message.
server/testclient_sendreportfile deleted +0
-36Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Thank you
Part of the diff is not shown here. View the raw message.