Netdata package does not create required directory "/var/lib/netdata"
The netdata package appears to be missing the creation of a needed directory, /var/lib/netdata
. Here's a demo:
Install the package and try running netdata:
$ docker run -it alpine:latest
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
v3.12.0-86-g64c1a9607a [http://dl-cdn.alpinelinux.org/alpine/v3.12/main]
v3.12.0-87-g1bb47e3a21 [http://dl-cdn.alpinelinux.org/alpine/v3.12/community]
OK: 12736 distinct packages available
/ # apk add netdata --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
fetch http://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/8) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(2/8) Installing ncurses-libs (6.2_p20200523-r0)
(3/8) Installing readline (8.0.4-r0)
(4/8) Installing bash (5.0.17-r0)
Executing bash-5.0.17-r0.post-install
(5/8) Installing libcap (2.27-r0)
(6/8) Installing libuuid (2.35.2-r0)
(7/8) Installing libuv (1.37.0-r0)
(8/8) Installing netdata (1.22.1-r0)
Executing netdata-1.22.1-r0.pre-install
Executing busybox-1.31.1-r16.trigger
OK: 14 MiB in 22 packages
/ # /usr/sbin/netdata -D
2020-06-22 22:31:59: netdata INFO : MAIN : CONFIG: cannot load cloud config '/var/lib/netdata/cloud.d/cloud.conf'. Running with internal defaults.
2020-06-22 22:31:59: netdata FATAL : MAIN :Cannot cd to directory '/var/lib/netdata' # : Invalid argument
2020-06-22 22:31:59: netdata INFO : MAIN : EXIT: netdata prepares to exit with code 1...
2020-06-22 22:31:59: netdata INFO : MAIN : EXIT: cleaning up the database...
2020-06-22 22:31:59: netdata INFO : MAIN : Cleaning up database [0 hosts(s)]...
2020-06-22 22:31:59: netdata INFO : MAIN : EXIT: all done - netdata is now exiting - bye bye...
Create /var/lib/netdata
by hand, and everything works:
/ # mkdir /var/lib/netdata
/ # chown netdata:netdata /var/lib/netdata
/ # /usr/sbin/netdata -D
2020-06-22 22:32:31: netdata INFO : MAIN : CONFIG: cannot load cloud config '/var/lib/netdata/cloud.d/cloud.conf'. Running with internal defaults.
2020-06-22 22:32:31: netdata INFO : MAIN : SIGNAL: Not enabling reaper
2020-06-22 22:32:31: netdata ERROR : MAIN : LISTENER: IPv6 bind() on ip '::1' port 19999, socktype 1 failed. (errno 99, Address not available)
2020-06-22 22:32:31: netdata ERROR : MAIN : LISTENER: Cannot bind to ip '::1', port 19999
2020-06-22 22:32:31: netdata INFO : MAIN : LISTENER: Listen socket tcp:127.0.0.1:19999 opened successfully.
Thanks, and please let me know if you need any further info.