netdata icon indicating copy to clipboard operation
netdata copied to clipboard

kickstart: Add detection of multiple concurrent installs.

Open Ferroin opened this issue 2 years ago • 0 comments

Summary

Such setups cause all kinds of problems, so properly detect and report them when possible (and refuse to continue until the situation is remidied) to help with debugging and avoid making things worse.

This is done by iteratively checking every directory in the search path, plus checking for the usual static install path without needing it explicitly specified. On regular runs without the issue at hand, this just makes the initial startup of the script a tiny bit slower (less than 0.01% in a Docker container on my laptop, likely similar on most other systems). On systems with multiple conflicting installs of the agent in the system search paths, it will instead bail at the second one it finds and report the issue.

Test Plan

The easiest way to test this is to install on a system that uses native packages, and then manually run a static install archive on the same system (not with the kickstart script, but by executing the .run file directly).

Without this PR, strange things happen when you try to use the kickstart script for anything on such a system (most notably, the static install will be completely untouched).

With this PR, such a setup should result in the kickstart script bailing out very early on with a fatal error mentioning that there are two installs of Netdata on the system.

Ferroin avatar Dec 06 '23 15:12 Ferroin