Skip to content

Conversation

@Ferroin
Copy link
Member

@Ferroin Ferroin commented Oct 30, 2025

Summary

This pushes handling of permissions and ownership of our required directories to systemd-tmpfiles when possible, which helps persistently ensure that they are correct, and allows us to make at least some Netdata service files both simpler and more reliable.

Test Plan

Requires manual testing on systemd systems.

This pushes handling of permissions and ownership of our required
directories to systemd-tmpfiles when possible, which helps persistently
ensure that they are correct, and allows us to make at least some Netdata
service files both simpler and more reliable.
@github-actions github-actions bot added area/packaging Packaging and operating systems support area/build Build system (autotools and cmake). labels Oct 30, 2025
@Ferroin Ferroin marked this pull request as ready for review October 31, 2025 11:05
@Ferroin Ferroin requested review from a team and vkalintiris as code owners October 31, 2025 11:05
@Ferroin Ferroin requested a review from a team October 31, 2025 11:05
@ilyam8 ilyam8 requested a review from Copilot October 31, 2025 11:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds systemd tmpfiles.d configuration support to automate the creation of runtime directories for Netdata. Instead of manually creating and setting permissions on directories at startup, the system leverages systemd-tmpfiles to handle directory creation with proper ownership and permissions.

Key Changes:

  • Introduced a new tmpfiles.d configuration file (tmpfiles.conf.in) that defines directory creation rules for /run/netdata, cache, lib, and log directories
  • Updated systemd service files to depend on systemd-tmpfiles-setup.service
  • Modified installation scripts to use systemd-tmpfiles --create when available, with fallback to manual directory creation

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
system/systemd/tmpfiles.conf.in New tmpfiles.d configuration defining directory creation rules
system/systemd/netdata.service.v235.in Added dependency on systemd-tmpfiles-setup.service
system/systemd/netdata.service.in Added tmpfiles dependency and removed manual directory creation commands
system/openrc/init.d/netdata.in Added systemd-tmpfiles-setup dependency for OpenRC
packaging/makeself/install-or-update.sh Integrated tmpfiles installation with fallback to manual chown
packaging/installer/netdata-uninstaller.sh Added cleanup of tmpfiles.d configuration
packaging/installer/functions.sh Added install_netdata_tmpfiles function
netdata.spec.in Added tmpfiles.d configuration to RPM package
netdata-installer.sh Replaced manual directory creation with tmpfiles approach
CMakeLists.txt Configured and installed tmpfiles.d configuration file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ilyam8 ilyam8 requested a review from Copilot October 31, 2025 11:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This adds new entries for the cloud.d and registry directories to be
created, as well as adding entries to apply correct permissions and
ownership for database files, claiming configuration, and a handful of
other files.
@ilyam8 ilyam8 requested a review from Copilot November 3, 2025 12:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR was tested in the following scenarios:

  • Debian package (Ubuntu 20.04)
  • RPMs (CentOS 9 Stream)
  • Compilation from scratch (Slackware Linux)

In all scenarios files were present with correct permission. LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build system (autotools and cmake). area/packaging Packaging and operating systems support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants