diff options
author | vkalintiris <vasilis@netdata.cloud> | 2023-12-13 16:41:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 16:41:20 +0200 |
commit | 92842d8422a570aed4005b5069531f7f5189fe4d (patch) | |
tree | 6923d0e00551ab448f7211e865577cd7a8991aef /packaging | |
parent | 548489555bbdadc7274a2165f365b968992b98da (diff) |
CMake build system. (#15996)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>
Co-authored-by: Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com>
Co-authored-by: Emmanuel Vasilakis <mrzammler@mm.st>
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Co-authored-by: netdatabot <bot@netdata.cloud>
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/installer/functions.sh | 132 | ||||
-rwxr-xr-x | packaging/installer/install-required-packages.sh | 2 |
2 files changed, 7 insertions, 127 deletions
diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh index dd3158d6dd..6cf8cdf145 100644 --- a/packaging/installer/functions.sh +++ b/packaging/installer/functions.sh @@ -463,45 +463,6 @@ get_systemd_service_dir() { fi } -install_non_systemd_init() { - [ "${UID}" != 0 ] && return 1 - key="$(get_os_key)" - - if [ -d /etc/init.d ] && [ ! -f /etc/init.d/netdata ]; then - if expr "${key}" : "^(gentoo|alpine).*"; then - echo >&2 "Installing OpenRC init file..." - run cp system/openrc/init.d/netdata /etc/init.d/netdata && - run chmod 755 /etc/init.d/netdata && - run rc-update add netdata default && - return 0 - - elif expr "${key}" : "^devuan*" || [ "${key}" = "debian-7" ] || [ "${key}" = "ubuntu-12.04" ] || [ "${key}" = "ubuntu-14.04" ]; then - echo >&2 "Installing LSB init file..." - run cp system/lsb/init.d/netdata /etc/init.d/netdata && - run chmod 755 /etc/init.d/netdata && - run update-rc.d netdata defaults && - run update-rc.d netdata enable && - return 0 - elif expr "${key}" : "^(amzn-201[5678]|ol|CentOS release 6|Red Hat Enterprise Linux Server release 6|Scientific Linux CERN SLC release 6|CloudLinux Server release 6).*"; then - echo >&2 "Installing init.d file..." - run cp system/initd/init.d/netdata /etc/init.d/netdata && - run chmod 755 /etc/init.d/netdata && - run chkconfig netdata on && - return 0 - else - warning "Could not determine what type of init script to install on this system." - return 1 - fi - elif [ -f /etc/init.d/netdata ]; then - echo >&2 "file '/etc/init.d/netdata' already exists." - return 0 - else - warning "Could not determine what type of init script to install on this system." - fi - - return 1 -} - run_install_service_script() { if [ -z "${tmpdir}" ]; then tmpdir="${TMPDIR:-/tmp}" @@ -565,90 +526,7 @@ install_netdata_service() { if [ -x "${NETDATA_PREFIX}/usr/libexec/netdata/install-service.sh" ]; then run_install_service_script && return 0 else - # This is used by netdata-installer.sh - # shellcheck disable=SC2034 - NETDATA_STOP_CMD="netdatacli shutdown-agent" - - NETDATA_START_CMD="netdata" - NETDATA_INSTALLER_START_CMD="" - - uname="$(uname 2> /dev/null)" - - if [ "${uname}" = "Darwin" ]; then - if [ -f "/Library/LaunchDaemons/com.github.netdata.plist" ]; then - echo >&2 "file '/Library/LaunchDaemons/com.github.netdata.plist' already exists." - return 0 - else - echo >&2 "Installing MacOS X plist file..." - # This is used by netdata-installer.sh - # shellcheck disable=SC2034 - run cp system/launchd/netdata.plist /Library/LaunchDaemons/com.github.netdata.plist && - run launchctl load /Library/LaunchDaemons/com.github.netdata.plist && - NETDATA_START_CMD="launchctl start com.github.netdata" && - NETDATA_STOP_CMD="launchctl stop com.github.netdata" - return 0 - fi - - elif [ "${uname}" = "FreeBSD" ]; then - # This is used by netdata-installer.sh - # shellcheck disable=SC2034 - run cp system/freebsd/rc.d/netdata /etc/rc.d/netdata && NETDATA_START_CMD="service netdata start" && - NETDATA_STOP_CMD="service netdata stop" && - NETDATA_INSTALLER_START_CMD="service netdata onestart" && - myret=$? - - echo >&2 "Note: To explicitly enable netdata automatic start, set 'netdata_enable' to 'YES' in /etc/rc.conf" - echo >&2 "" - - return "${myret}" - - elif issystemd; then - # systemd is running on this system - NETDATA_START_CMD="systemctl start netdata" - # This is used by netdata-installer.sh - # shellcheck disable=SC2034 - NETDATA_STOP_CMD="systemctl stop netdata" - NETDATA_INSTALLER_START_CMD="${NETDATA_START_CMD}" - - SYSTEMD_DIRECTORY="$(get_systemd_service_dir)" - - if [ "${SYSTEMD_DIRECTORY}x" != "x" ]; then - ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED="run systemctl enable netdata" - IS_NETDATA_ENABLED="$(systemctl is-enabled netdata 2> /dev/null || echo "Netdata not there")" - if [ "${IS_NETDATA_ENABLED}" = "disabled" ]; then - echo >&2 "Netdata was there and disabled, make sure we don't re-enable it ourselves" - ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED="true" - fi - - echo >&2 "Installing systemd service..." - run cp system/systemd/netdata.service "${SYSTEMD_DIRECTORY}/netdata.service" && - run systemctl daemon-reload && - ${ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED} && - return 0 - else - warning "Could not find a systemd service directory, unable to install Netdata systemd service." - fi - else - install_non_systemd_init - ret=$? - - if [ ${ret} -eq 0 ]; then - if [ -n "${service_cmd}" ]; then - NETDATA_START_CMD="service netdata start" - # This is used by netdata-installer.sh - # shellcheck disable=SC2034 - NETDATA_STOP_CMD="service netdata stop" - elif [ -n "${rcservice_cmd}" ]; then - NETDATA_START_CMD="rc-service netdata start" - # This is used by netdata-installer.sh - # shellcheck disable=SC2034 - NETDATA_STOP_CMD="rc-service netdata stop" - fi - NETDATA_INSTALLER_START_CMD="${NETDATA_START_CMD}" - fi - - return ${ret} - fi + warning "Could not find service install script, not installing Netdata as a system service." fi fi @@ -1061,9 +939,11 @@ install_netdata_updater() { cat "${NETDATA_SOURCE_DIR}/packaging/installer/netdata-updater.sh" > "${NETDATA_PREFIX}/usr/libexec/netdata/netdata-updater.sh" || return 1 fi - if issystemd && [ -n "$(get_systemd_service_dir)" ]; then - cat "${NETDATA_SOURCE_DIR}/system/systemd/netdata-updater.timer" > "$(get_systemd_service_dir)/netdata-updater.timer" - cat "${NETDATA_SOURCE_DIR}/system/systemd/netdata-updater.service" > "$(get_systemd_service_dir)/netdata-updater.service" + # these files are installed by cmake + libsysdir="${NETDATA_PREFIX}/usr/lib/netdata/system/systemd/" + if [ -d "${libsysdir}" ] && issystemd && [ -n "$(get_systemd_service_dir)" ]; then + cat "${libsysdir}/netdata-updater.timer" > "$(get_systemd_service_dir)/netdata-updater.timer" + cat "${libsysdir}/netdata-updater.service" > "$(get_systemd_service_dir)/netdata-updater.service" fi sed -i -e "s|THIS_SHOULD_BE_REPLACED_BY_INSTALLER_SCRIPT|${NETDATA_USER_CONFIG_DIR}/.environment|" "${NETDATA_PREFIX}/usr/libexec/netdata/netdata-updater.sh" || return 1 diff --git a/packaging/installer/install-required-packages.sh b/packaging/installer/install-required-packages.sh index 4217233b22..fa4ca755e2 100755 --- a/packaging/installer/install-required-packages.sh +++ b/packaging/installer/install-required-packages.sh @@ -946,7 +946,7 @@ declare -A pkg_postfix=( ) declare -A pkg_pkg_config=( - ['alpine']="pkgconfig" + ['alpine']="pkgconf" ['arch']="pkgconfig" ['centos']="pkgconfig" ['debian']="pkg-config" |