0
0
mirror of https://github.com/netdata/netdata.git synced 2024-11-23 08:07:44 +00:00
netdata_netdata/system/runit
Austin S. Hemmelgarn 39e629e24c
Consistently start the agent as root and rely on it to drop privileges properly. (#14890)
* Consolidate preparation of required directories.

The only differences between cases where the prep is done is how we
derive the UID and GID that get passed to some of the functions. By just
encapsulating the preparation in a function like this, we make this
differentiation obvious while also making it easier to modify what
directories need to be created or prepared.

* Create the log directory if it does not already exist.

We treat the log directory not existing as a fatal error, but we can (in
most cases) just create it on startup, so just do so.

* Trust netdata to handle dropping privileges itself.

This allows more correct behavior with respect to handling of required
directories, and also ensures that our system service scripts properly
support running the agent as arbitrary users instead of requiring it to
run as the user configured at build time.

* Fix build issues.

* Move directory creation to be done alongside directory existence checks.

* Fix syntax errors and address review feedback.
2023-06-15 07:33:26 -04:00
..
run.in Consistently start the agent as root and rely on it to drop privileges properly. (#14890) 2023-06-15 07:33:26 -04:00