aports/community/netdata/openrc-pidfile-not-writable-by-user.patch
Kevin Daudt efe55d1aa6 community/netdata: upgrade to 1.45.3
- Switch build system to cmake
- Disable ebpf plugin (cannot be built at the moment)
- Include the go plugin (uses the original separate package name)
- Use upstream openrc init files

CVE-2024-32019 does not apply to us since we never upgraded to the
vulnerable versions.
2024-05-06 15:51:25 +00:00

45 lines
1.4 KiB
Diff

diff --git a/system/openrc/conf.d/netdata.in b/system/openrc/conf.d/netdata.in
index 92f8826..b07972b 100644
--- a/system/openrc/conf.d/netdata.in
+++ b/system/openrc/conf.d/netdata.in
@@ -15,10 +15,6 @@ NETDATA_FORCE_EXIT=0
# work around issues.
#NETDATA_USE_NETDATACLI=1
-# Specify the path to the pidfile to be used when running in the
-# background.
-NETDATA_PIDFILE="@localstatedir_POST@/run/netdata/netdata.pid"
-
# Uncomment the below line to run Netdata under OpenRC's native process
# supervision.
#supervisor="supervise-daemon"
diff --git a/system/openrc/init.d/netdata.in b/system/openrc/init.d/netdata.in
index 23d1a56..4912297 100644
--- a/system/openrc/init.d/netdata.in
+++ b/system/openrc/init.d/netdata.in
@@ -12,8 +12,8 @@ description_rotate="Reopen log files."
command_prefix="@sbindir_POST@"
command="${command_prefix}/netdata"
-command_args="-P ${NETDATA_PIDFILE} ${NETDATA_EXTRA_ARGS}"
+command_args="${NETDATA_EXTRA_ARGS}"
command_args_foreground="-D"
depend() {
use logger
@@ -22,10 +23,11 @@ depend() {
}
start_pre() {
- checkpath -o ${NETDATA_OWNER} -d @localstatedir_POST@/run/netdata
+ checkpath -o root -d @CMAKE_INSTALL_PREFIX@/run/netdata
-
if [ -z "${supervisor}" ]; then
- pidfile="${NETDATA_PIDFILE}"
+ command_args="$command_args -D"
+ command_background=true
+ pidfile="@CMAKE_INSTALL_PREFIX@/run/netdata/netdata.pid"
fi
}