Hello!
I’m trying to install netdata agent on fresh new debian 12 VPS using the kickstart.sh snippet.
If I try to run the wget [.....]
snippet using a normal user (not root), the installation completes with a warning:
[/tmp/netdata-kickstart-CKpNZWeafd]$ sudo reload-claiming-state
sudo: : command not found
FAILED
WARNING Failed to write claiming configuration. This usually means you do not have permissions to access the configuration directory.
If I try to run the wget [...]
snipped using root, I do not get any warning and I noticed that the command above is different:
[/tmp/netdata-kickstart-vvNCshGN0C]# /usr/sbin/netdatacli reload-claiming-state
As you can see, the /usr/sbin/netdatacli
part is present only when the script is run with root
So, I open the script file and I’ve noticed these lines
# more lines
netdatacli="$(command -v netdatacli)"
# more lines
if [ -z "${NETDATA_CLAIM_NORELOAD}" ]; then
run_as_root "${netdatacli}" reload-claiming-state || return 1
fi
So the problem must be with command -v netdatacli
In fact, when I run command -v netdatacli
with my normal user I get nothing, when I run it as root I get /usr/sbin/netdatacli
That’s because my normal user does not have /usr/sbin
in its PATH, while root user has it.
So, my question is: is this a bug in the netdata installation script? Or, should I always run the installation script as root ? The documentation does not say that you have to run it as root though, and it supports sudo so I suppose this should work even when it is run as a normal user