diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-06-14 19:18:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 19:18:08 +0300 |
commit | 3c507b4edb796f5a5cc7c6bcabfd9142494977cd (patch) | |
tree | 7d780eb583cf3f438929d3858a4a3cf539a11476 /packaging | |
parent | 0c43d1544ffba4fae9d60228fc78bad7e9725869 (diff) |
add netdata journald configuration (#17882)
* add netdata journald configuration
* update uninstaller
* put in "/usr/lib/systemd/journald@netdata.conf.d/"
* update uninstaller
* Update CMakeLists.txt
Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
* Update system/systemd/journald@netdata.conf
* fix
* usr/lib
---------
Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/installer/functions.sh | 22 | ||||
-rwxr-xr-x | packaging/installer/netdata-uninstaller.sh | 2 | ||||
-rwxr-xr-x | packaging/makeself/install-or-update.sh | 4 |
3 files changed, 28 insertions, 0 deletions
diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh index d636ddcff8..6143eedb4e 100644 --- a/packaging/installer/functions.sh +++ b/packaging/installer/functions.sh @@ -910,6 +910,28 @@ install_netdata_logrotate() { } # ----------------------------------------------------------------------------- +# install netdata journald configuration + +install_netdata_journald_conf() { + src="${NETDATA_PREFIX}/usr/lib/netdata/system/systemd/journald@netdata.conf" + + [ ! -d /usr/lib/systemd/ ] && return 0 + [ "${UID}" -ne 0 ] && return 1 + + if [ ! -d /usr/lib/systemd/journald@netdata.conf.d/ ]; then + run mkdir /usr/lib/systemd/journald@netdata.conf.d/ + fi + + run cp "${src}" /usr/lib/systemd/journald@netdata.conf.d/netdata.conf + + if [ -f /usr/lib/systemd/journald@netdata.conf.d/netdata.conf ]; then + run chmod 644 /usr/lib/systemd/journald@netdata.conf.d/netdata.conf + fi + + return 0 +} + +# ----------------------------------------------------------------------------- # create netdata.conf create_netdata_conf() { diff --git a/packaging/installer/netdata-uninstaller.sh b/packaging/installer/netdata-uninstaller.sh index 1627ca6b5d..c69bbd56ee 100755 --- a/packaging/installer/netdata-uninstaller.sh +++ b/packaging/installer/netdata-uninstaller.sh @@ -729,6 +729,7 @@ fi #### REMOVE NETDATA FILES rm_file /etc/logrotate.d/netdata +rm_file /usr/lib/systemd/journald@netdata.conf.d/netdata.conf rm_file /etc/systemd/system/netdata.service rm_file /lib/systemd/system/netdata.service rm_file /usr/lib/systemd/system/netdata.service @@ -764,6 +765,7 @@ else rm_dir "${NETDATA_PREFIX}/var/cache/netdata" rm_dir "${NETDATA_PREFIX}/var/log/netdata" rm_dir "${NETDATA_PREFIX}/etc/netdata" + rm_dir /usr/lib/systemd/journald@netdata.conf.d/ fi if [ -n "${tmpdir}" ]; then diff --git a/packaging/makeself/install-or-update.sh b/packaging/makeself/install-or-update.sh index 67be9d69c5..d2350a7904 100755 --- a/packaging/makeself/install-or-update.sh +++ b/packaging/makeself/install-or-update.sh @@ -124,6 +124,10 @@ progress "Install logrotate configuration for netdata" install_netdata_logrotate || run_failed "Cannot install logrotate file for netdata." +progress "Install journald configuration for netdata" + +install_netdata_journald_conf || run_failed "Cannot install journald file for netdata." + # ----------------------------------------------------------------------------- progress "Telemetry configuration" |