From 341c46de84b18226f95b07bbd4c35ba56b42dd40 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 4 Aug 2022 17:38:34 +0200 Subject: contrib: improve motd for nm-in-container.sh script Leave a hint about core-dumps. Also, now we have `contrib/fedora/rpm/configure-for-system.sh` script, which can configure the build in a way similar to what we get when doing an RPM build. That means, inside "contrib/scripts/nm-in-container.sh" we can just type `make install`, and it will replace the pre-installed NetworkManager. The main advantage is that it becomes convenient to run NetworkManager as a systemd service. Previously, the suggested was to to install NetworkManager inside another prefix, and run it in the terminal. Running NetworkManager as systemd service is also necessary for NM-ci, which restarts the NetworkManager service, and you couldn't run a test, if you just started NetworkManager in a terminal. Previously, you had to build a complete RPM, which takes a lot of time. --- contrib/scripts/nm-in-container.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/scripts/nm-in-container.sh b/contrib/scripts/nm-in-container.sh index 72b3f1130a..c8f5ad62e2 100755 --- a/contrib/scripts/nm-in-container.sh +++ b/contrib/scripts/nm-in-container.sh @@ -113,7 +113,19 @@ create_dockerfile() { find NetworkManager bind mounted at $BASEDIR_NM run \`nm-env-prepare.sh setup --idx 1\` to setup test interfaces -Configure NetworkManager with +Coredumps: coredumps are not namespaced, so by default they will +be sent to coredumpctl of the outer host, which has no idea where +to get the debugging symbols from. A possible workaround is setting + + $ echo '/tmp/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern + +so that core dumps get written to file. Afterwards, restore with + + echo '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h' | sudo tee /proc/sys/kernel/core_pattern + +from /usr/lib/sysctl.d/50-coredump.conf. + +For example, configure NetworkManager with \$ ./configure \\ --enable-address-sanitizer=no \\ --enable-compile-warnings=yes \\ @@ -164,6 +176,10 @@ Configure NetworkManager with "\${NM_CONFIGURE_OTPS[@]}" Test with: \$ systemctl stop NetworkManager; /opt/test/sbin/NetworkManager --debug 2>&1 | tee -a /tmp/nm-log.txt + +Alternatively, configure with \`contrib/fedora/rpm/configure-for-system.sh\`, +subsequent \`make && make install\` will overwrite your system's NetworkManager, +and you can test it with \`systemctl daemon-reload ; systemctl restart NetworkManager\`. EOF cat <