0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-16 10:31:07 +00:00
netdata_netdata/system
Austin S. Hemmelgarn 56e22c16e8
Cleanly reimplement system/edit-config.in. ()
* Cleanly reimplement system/edit-config.in

- Added support for pulling config files from Docker containers.
- Added auto-detection for Docker containers.
- Use directory the script is in for target directory for config files
  instead of templating it in at build time.
- Prefix error messages with `ERROR:`.
- Robustly check for a valid editor _before_ invoking it.
- Add support for actual command-line options, including a proper
  `--help` option.
- Use prefix matching of absolute paths to determine file validity
  instead of blindly excluding certain path types.
- If editing a non-existing file we do not provide a stock copy of,
  create an empty file instead of throwing an error.
- Make the whole script properly modular.

* Improve robustness of container autodetection.

Instead of relying on the lack of certain directories on a host system,
use some relatively standard checks to determine if we appear to be
running in a container.

* Auto-detect stock config paths at runtinme instead of hard-coding them at build time.

THis will simplify testing of the script, as well as making it a bit
more resilient to users moving things around.

* Add an option to list known config files.

* Fix container environment check to not require root.

* Fix help output.

* Fix path prefix check.

* Fix file path handling.

* Use correct variable when editing files.

* Use correct path for `env`.

* Source profile before running `set -e`.

To prevent questionablly written profiles from causing the script to
exit.

* Produce columnar output when listing valid files.

* Fix copy check.

* Fix build issues.

* fix build issues

* formatting

Co-authored-by: ilyam8 <ilya@netdata.cloud>
2022-12-06 10:53:30 -05:00
..
.install-type Store info about the installation type for later retrieval. () 2021-05-24 07:34:09 -04:00
edit-config Cleanly reimplement system/edit-config.in. () 2022-12-06 10:53:30 -05:00
install-service.sh.in Properly guard commands when installing services for offline service managers. () 2022-10-19 07:11:09 -04:00
Makefile.am Cleanly reimplement system/edit-config.in. () 2022-12-06 10:53:30 -05:00
netdata-freebsd.in Fix runtime directory ownership when installed as non-root user. () 2022-10-18 13:14:39 -04:00
netdata-init-d.in Fix runtime directory ownership when installed as non-root user. () 2022-10-18 13:14:39 -04:00
netdata-lsb.in Fix runtime directory ownership when installed as non-root user. () 2022-10-18 13:14:39 -04:00
netdata-openrc.in Assorted cleanup in the OpenRC init script. () 2022-10-25 07:33:11 -04:00
netdata-updater.service.in Added improved auto-update support. () 2020-09-28 07:07:18 -04:00
netdata-updater.timer Added improved auto-update support. () 2020-09-28 07:07:18 -04:00
netdata.conf replace history with relevant dbengine params () 2022-05-31 15:06:15 +03:00
netdata.crontab.in Added support for using /etc/cron.d for auto-updates. () 2020-09-15 07:40:05 -04:00
netdata.logrotate.in netdata pid is in run/netdata/netdata.pid 2018-09-11 17:55:42 +03:00
netdata.plist.in fix spdx () 2018-09-30 02:36:42 +03:00
netdata.service.in allow netdata installer to install and run netdata as any user () 2022-10-09 17:02:30 +03:00
netdata.service.v235.in Change default OOM score and scheduling policy to behave more sanely. () 2022-03-11 18:22:37 +02:00