summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan <jan.vermaete@gmail.com>2021-09-22 19:54:32 +0200
committerKhem Raj <raj.khem@gmail.com>2021-09-24 08:12:35 -0700
commit371adeaade7ae1e5dc628dd6e95423539534eefe (patch)
tree9504a86d8947c65617d4762a7a6d1cc1a61e1be2
parentf8fb68218b0e4776cc371e6f1e64d79c5f3675db (diff)
downloadmeta-openembedded-371adeaade7ae1e5dc628dd6e95423539534eefe.tar.gz
netdata: Fixed the recipe.
The netdata website was not accessable due to some (changed) permissions. The systemd service file will start netdata deamon with the netdata user. The netdata group as existing, but the netdata user was missing. I moved some directory creations from systemd to the bitbake recipe. The project website address changed too. Removed the creation of the pid file in the service of systemd. Netdata itself has an option to create the pid file. Because it's an options, it's probably also not needed in systemd. Tested with meta-raspberrypi on rpi4-32. Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-webserver/recipes-webadmin/netdata/netdata/netdata.service12
-rw-r--r--meta-webserver/recipes-webadmin/netdata/netdata_git.bb19
2 files changed, 21 insertions, 10 deletions
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata/netdata.service b/meta-webserver/recipes-webadmin/netdata/netdata/netdata.service
index b244d18665..ca13f72871 100644
--- a/meta-webserver/recipes-webadmin/netdata/netdata/netdata.service
+++ b/meta-webserver/recipes-webadmin/netdata/netdata/netdata.service
@@ -1,13 +1,15 @@
1# SPDX-License-Identifier: GPL-3.0-or-later
1[Unit] 2[Unit]
2Description=Netdata, Real-time performance monitoring 3Description=Real time performance monitoring
3RequiresMountsFor=/var 4RequiresMountsFor=/var
5After=network.target
4 6
5[Service] 7[Service]
6User=root 8Type=simple
7ExecStartPre=/bin/mkdir -p /var/log/netdata 9ExecStartPre=/bin/mkdir -p /var/log/netdata
8ExecStartPre=/bin/chown -R nobody.netdata @@datadir/netdata/web 10ExecStartPre=/bin/chown -R netdata.netdata /var/log/netdata
9ExecStartPre=/bin/chown -R nobody.netdata /var/cache/netdata 11ExecStart=/usr/sbin/netdata -D -u netdata
10ExecStart=/usr/sbin/netdata -nd 12
11 13
12[Install] 14[Install]
13WantedBy=multi-user.target 15WantedBy=multi-user.target
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata_git.bb b/meta-webserver/recipes-webadmin/netdata/netdata_git.bb
index 7c48b8a37d..7ec9898152 100644
--- a/meta-webserver/recipes-webadmin/netdata/netdata_git.bb
+++ b/meta-webserver/recipes-webadmin/netdata/netdata_git.bb
@@ -1,17 +1,19 @@
1HOMEPAGE = "https://github.com/firehol/netdata/" 1HOMEPAGE = "https://github.com/netdata/netdata/"
2SUMMARY = "Real-time performance monitoring" 2SUMMARY = "Real-time performance monitoring"
3DESCRIPTION = "Netdata is high-fidelity infrastructure monitoring and troubleshooting. \
4 Open-source, free, preconfigured, opinionated, and always real-time."
3LICENSE = "GPLv3" 5LICENSE = "GPLv3"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24"
5 7
6SRC_URI = "git://github.com/firehol/netdata.git;protocol=https" 8SRC_URI:append = " git://github.com/firehol/netdata.git;protocol=https"
7SRCREV = "1be9200ba8e11dc81a2101d85a2725137d43f766" 9SRCREV = "1be9200ba8e11dc81a2101d85a2725137d43f766"
8PV = "1.22.1" 10PV = "1.22.1"
9 11
10# default netdata.conf for netdata configuration 12# default netdata.conf for netdata configuration
11SRC_URI += "file://netdata.conf" 13SRC_URI += " file://netdata.conf"
12 14
13# file for providing systemd service support 15# file for providing systemd service support
14SRC_URI += "file://netdata.service" 16SRC_URI += " file://netdata.service"
15 17
16S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
17 19
@@ -31,7 +33,7 @@ SYSTEMD_AUTO_ENABLE:${PN} = "enable"
31 33
32#User specific 34#User specific
33USERADD_PACKAGES = "${PN}" 35USERADD_PACKAGES = "${PN}"
34GROUPADD_PARAM:${PN} = "--system netdata" 36USERADD_PARAM:${PN} = "--system --no-create-home --home-dir ${localstatedir}/run/netdata --user-group netdata"
35 37
36do_install:append() { 38do_install:append() {
37 #set S UID for plugins 39 #set S UID for plugins
@@ -50,6 +52,13 @@ do_install:append() {
50 sed -i -e 's,@@sysconfdir,${sysconfdir},g' ${D}${sysconfdir}/netdata/netdata.conf 52 sed -i -e 's,@@sysconfdir,${sysconfdir},g' ${D}${sysconfdir}/netdata/netdata.conf
51 sed -i -e 's,@@libdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf 53 sed -i -e 's,@@libdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf
52 sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf 54 sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf
55
56 install --group netdata --owner netdata --directory ${D}${localstatedir}/cache/netdata
57 install --group netdata --owner netdata --directory ${D}${localstatedir}/lib/netdata
58
59 chown -R netdata:netdata ${D}${datadir}/netdata/web
53} 60}
54 61
62FILES_${PN} += "${localstatedir}/cache/netdata/ ${localstatedir}/lib/netdata/"
63
55RDEPENDS:${PN} = "bash zlib" 64RDEPENDS:${PN} = "bash zlib"