Telegraf test input and output plugins error multiple conf files - testing

Telegraf version: Telegraf v1.0.1
I have the following files:
/etc/telegraf/telegraf.conf
main config file (which you create/get for free while installing telegraf). This file doesn't have any [[output.<plugin>]] stanza in it but does have valid default inputs.xx plugins enabled.
/etc/telegraf/telegraf.d/1-company-output-plugin.conf
(This file has valid outputs.<pluginname> plugin).
/etc/telegraf/telegraf.d/telegraf-additional-inputs-plugins.conf
(this file has additional inputs.<pluginname> plugins that I want to keep separate from the main conf file).
Running sudo service telegraf status shows Telegraf is running [OK]! and log file /var/log/telegrag/telegraf.log (looks good too without showing any errors).
If I make any changes to one of the above configuration files, I want to test those changes made (before I restart telegraf), so I'm running the following commands with -test or --test option but I'm getting the following error:
ubuntu#jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf -test
2017/01/10 22:45:48 E! Error: no outputs found, did you provide a valid config file?
ubuntu#jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf --test
2017/01/10 22:45:51 E! Error: no outputs found, did you provide a valid config file?
As you see above, both optons -test or --test worked but also gave a valid error message above.
As the above error was for not providing any configuration stanza for [[outputs.<plugin>]], I provided another --config file paramter for the file which contains the outputs plugin stanza, but now it gave an error for the missing inputs. file:
ubuntu#jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf --config /etc/telegraf/telegraf.d/1-company-output-plugin.conf --test
2017/01/10 22:48:30 E! Error: no inputs found, did you provide a valid config file?
ubuntu#jenkins:~/test_aks_dir$
Note: The above command didn't error for providing multiple --config <someConfigFile> parameter values.
The same error comes if I want to test any change in the 3rd file : (/etc/telegraf/telegraf.d/telegraf-additional-inputs-plugins.conf)
How can I test an individual or selective configuration file changes using telegraf assuming I have multiple files here: /etc/telegraf/telegraf.d/*.conf ?

this is not possible at the moment, the only way to do it would be to specify the entire config directory

Related

singularity relocation error when sourcing file in environment section

I'm trying to create a Singularity image for some application software that normally builds into a single directory. To use after building, you source a setup file "env.sh" that sets a bunch of environment variables including modifying PATH and LD_LIBRARY_PATH.
If my recipe looks like this:
Bootstrap: docker
From: ubuntu:20.04
%files
/path/to/myapp /opt/myapp
%post
cd /opt/myapp && make
%environment
. /opt/myapp/env.sh
so that env.sh is sourced automatically on launching the image, I get the following error:
Singularity runtime parent: relocation error: /lib/x86_64-linux-gnu/libnss_files.so.2: symbol __libc_readline_unlocked, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
However, if I remove the %environment section from the recipe, then manually call . /opt/myapp/env.sh after invoking singularity shell, everything works as expected.
Given that the environment script is not doing anything other than setting some environment variables, why am I getting this error?

Cannot install kernel-devsrc

I'm trying to set up my environment to use Yocto's generated SDK to compile my out-of-tree module, but for some reason, I'm getting an error.
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
I'm using Poky distribution and meta-raspberrypi which is needed because I'm using the RPI ZeroW board.
Apart from this everything works fine. I'm able to compile the entire image and load it on the board.
Here is the line I've added to local.conf
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"
as I've found in the documentation.
Also below you can find the whole log from the compilation.
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-bsp/u-boot/u-boot-tools_2020.07.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/binutils/binutils-cross_2.35.1.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/gcc/gcc-cross_10.2.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-support/gmp/gmp_6.2.0.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-extended/xz/xz_5.2.5.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-connectivity/openssl/openssl_1.1.1k.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/bison/bison_3.7.2.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-core/glibc/glibc_2.32.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_10.2.bb:do_populate_sysroot']
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: ['u-boot-tools-native', 'binutils-cross-arm', 'kmod-native', 'gcc-cross-arm', 'gmp-native', 'pkgconfig-native', 'xz-native', 'openssl-native', 'bison-native', 'quilt-native', 'bc-native', 'glibc', 'patch-native', 'kern-tools-native', 'pseudo-native', 'gcc-runtime', 'python3-native', 'gnu-config-native', 'autoconf-native', 'libtool-native', 'gtk-doc-native', 'automake-native', 'zlib-native', 'texinfo-dummy-native', 'readline-native', 'flex-native', 'attr-native', 'libmpc-native', 'mpfr-native', 'linux-libc-headers', 'gettext-minimal-native', 'libgcc', 'libnsl2-native', 'gdbm-native', 'libffi-native', 'bzip2-native', 'util-linux-native', 'sqlite3-native', 'libtirpc-native', 'm4-native', 'ncurses-native', 'libcap-ng-native', 'libpcre2-native']
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing shell function do_install
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/home/pp/yocto-hh/build/tmp/work/hhctrl-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.109942' failed with exit code 1:
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
WARNING: exit code 1 from a shell command
The command I am using to produce the SDK is:
bitbake name-of-my-image -c populate_sdk
What could be the problem here? Or how should I debug it? I've found a few touching on the subject and it seems that it should be already fixed, but for some reason, in my environment, it still does not work.
Missing the module.lds file in the latest kernel. Apply the following source code as a patch in the kernel and build the image.
diff -Naur a/arch/arm/kernel/module.lds b/arch/arm/kernel/module.lds
--- a/arch/arm/kernel/module.lds 1970-01-01 05:30:00.000000000 +0530
+++ b/arch/arm/kernel/module.lds 2020-02-28 21:53:45.000000000 +0530
## -0,0 +1,5 ##
+/* SPDX-License-Identifier: GPL-2.0 */
+SECTIONS {
+ .plt : { BYTE(0) }
+ .init.plt : { BYTE(0) }
+}

Chromium single executable build

I've been following the documentation here to build Chromium on Ubuntu 18.
I've been able to successfully build using these flags gn gen out/amd64 --args='is_official_build=true is_debug=false'
and this command to build
autoninja -C out/amd64 chrome
The problem is that the outputting chrome file has dependencies on all the other files in the directory. When I copy the chrome file to another directory and execute it, I get this error
[0608/170138.585281:ERROR:icu_util.cc(165)] Invalid file descriptor to ICU data received.
Trace/breakpoint trap (core dumped)
How do I go about building Chromium so I can execute it from a single file like how Puppeteer is a single executable?

How can I solve this problem of installation xampp on fedora?

When I run xampp on fedora this error is showing up on application log
Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
httpd: Syntax error on line 522 of /opt/lampp/etc/httpd.conf: Syntax error on line 10 of /opt/lampp/etc/extra/httpd-xampp.conf: Cannot load modules/libphp7.so into server: libnsl.so.1: cannot open shared object file: No such file or directory
can anyone tell me how can I solve this?
it seems you're missing libnsl. install it through this command:
sudo dnf install libnsl
In case this doesn't work you can then download it manually:
Visit https://pkgs.org/
In the search box (pkgs.org of course) type libnsl.so.1 and choose the appropriate OS. The version shown might be higher e.g libnsl-2.28-9.fc29.x86_64.rpm, but it doesn't matter, the file needed is also included in this very package.
In the terminal, navigate to the directory where the .rpm was downloaded.
Type the following command to install it:
sudo rpm libnsl-2.XX-X.fc29.x86_64.rpm
Upon completion everything should be working fine.
A quick Google search returns this: https://www.reddit.com/r/Fedora/comments/8hlhlv/xampp_with_fedora_28/
The suggested fix is installing libnsl from this source:
https://www.rpmfind.net/linux/rpm2html/search.php?query=libnsl.so.1%28%29%2864bit%29&submit=Search+...&system=fedora&arch=

Capturing log files generated by cmake within singularity image before the image cleans up after failed build

I'm building an application using a Singularity (v. 2.5.1) recipe file. At some point it fails during the build, cmake fails and writes a errors to a log file within the singularity image.
To build the image :
sudo /opt/singularity/2.5.1/bin/singularity build test.simg Singularity
The end of the stdout output (printed to terminal) from the build is :
.
.
.
MKL is found at /my_dir/intel/mkl
CMake Error at cmake/FindMKL.cmake:83 (error):
Unknown CMake command "error".
Call Stack (most recent call first):
CMakeLists.txt:262 (find_package)
-- Configuring incomplete, errors occurred!
See also "/my_dir/code/gadgetron/build/CMakeFiles/CMakeOutput.log".
The problem is that since the singularity image build failed, there isn't an image to investigate the logs.
QUESTION : How do I preserve the logs or files from the build process when the image itself fails to build? Perhaps there is a way in cmake to redirect the output from CMakeOutput.log to stdout?