Modify getMyIP to cache the local machine's IP address, and
return it without further accessing of the underlying resolver
libraries during subsequent invocations.
getMyIP is called roughly once a second from within monitor_loop
when refreshing CPU utilization in the bottom-right corner of
the GUI window. Other, dedicated CPU usage windows might also
call getMyIP at regular intervals.
With systemd commit cda458a54 (between v232 and v233), the
implementation of gethostbyname4_r() was updated to a more
intransigently standard-compliant error reporting convention,
which in turn causes glibc to retry in a more labor intensive
way (see https://github.com/systemd/systemd/pull/5359).
Under certain circumstances depending on the local hostname
and IP configuration, the glibc/systemd back-end resolver
routines triggered by getMyIP's call to [socket ...] and
[fconfigure ...] end up taking long enough to noticeably slow
down refreshing the main core-gui window, to the point where
interaction with the GUI becomes difficult.
Signed-off-by: Gabriel Somlo <glsomlo@cert.org>
Building compliant RPM packages for Fedora/RHEL/Centos requires all
dependencies to be satisfied via the distribution specific packaging
infrastructure (i.e. rpm + yum|dnf). To ensure that packages correctly
pull in their dependencies (i.e., without relying on side-loaded
software that just happens to be installed on the host where they're
being built), the best practice recommended is to build them in "mock".
E.g.,
rpmbuild -bs core.spec
mock -r fedora-rawhide-x86_64 core-*.src.rpm
This patch modifies the enclosed spec file to correctly list all
other RPM packages required to build and run core-* RPMs.
Note that at the time of this writing the "python-logzero" package
is pending release into the Fedora (26 and newer) repositories:
https://bugzilla.redhat.com/show_bug.cgi?id=1514100
Signed-off-by: Gabriel Somlo <glsomlo@cert.org>
On x86_64, the "core_python_netns" module is installed into ${pyexecdir},
a.k.a. %{python_sitearch}, a.k.a. "/usr/lib64/python2.7/site-packages".
Adding ${pyexecdir} to $PYTHONPATH will prevent the "install" target in
"daemon/src/Makefile" from failing.
Signed-off-by: Gabriel Somlo <glsomlo@cert.org>
Since version 5.0, python modules (e.g. core, corens3, and netns)
are installed as .egg bundles, and are not available for importing
by default, unless explicitly we use "pkg-resources.require()".
Signed-off-by: Gabriel Somlo <glsomlo@cert.org>
This solves #128
gcc7 has a compatibility problem with python and issues a warning as described at https://bugzilla.redhat.com/show_bug.cgi?id=1473425
Setting the `-Werror` flag treats all warnings as errors, which fails the build. IMHO it is better to remove the flag from regular builds. Advanced users can add it if they choose to.