summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2023-02-27 12:38:25 -0500
committerGitHub <noreply@github.com>2023-02-27 12:38:25 -0500
commit8b93deb7b0916ea5caabfb24dbc6420e01054cbe (patch)
treef08ec8b80c6752a71c39f06e50de25f7df2cd3e7 /packaging
parent732654d592a3d49c8f1a154a8d4bb3c475e027d9 (diff)
Reorganize system directory to better reflect what files are actually used for. (#14544)
* Move systemd-specific system files to their own directory. * Move non-systemd init scripts to individual subdirectories. * Move cron files to their own directory. * Move logrotate config to it’s own directory. * Fix typos in Makefile.am. * Fix Debian package builds. * Fixed issues reported by @andrewm4894.
Diffstat (limited to 'packaging')
-rw-r--r--packaging/installer/functions.sh18
-rwxr-xr-xpackaging/makeself/jobs/99-makeself.install.sh6
2 files changed, 10 insertions, 14 deletions
diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh
index 1f121da4de..b79c98aea1 100644
--- a/packaging/installer/functions.sh
+++ b/packaging/installer/functions.sh
@@ -470,21 +470,21 @@ install_non_systemd_init() {
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/netdata-openrc /etc/init.d/netdata &&
+ 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/netdata-lsb /etc/init.d/netdata &&
+ 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/netdata-init-d /etc/init.d/netdata &&
+ run cp system/initd/init.d/netdata /etc/init.d/netdata &&
run chmod 755 /etc/init.d/netdata &&
run chkconfig netdata on &&
return 0
@@ -582,7 +582,7 @@ install_netdata_service() {
echo >&2 "Installing MacOS X plist file..."
# This is used by netdata-installer.sh
# shellcheck disable=SC2034
- run cp system/netdata.plist /Library/LaunchDaemons/com.github.netdata.plist &&
+ 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"
@@ -592,7 +592,7 @@ install_netdata_service() {
elif [ "${uname}" = "FreeBSD" ]; then
# This is used by netdata-installer.sh
# shellcheck disable=SC2034
- run cp system/netdata-freebsd /etc/rc.d/netdata && NETDATA_START_CMD="service netdata start" &&
+ 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=$?
@@ -621,7 +621,7 @@ install_netdata_service() {
fi
echo >&2 "Installing systemd service..."
- run cp system/netdata.service "${SYSTEMD_DIRECTORY}/netdata.service" &&
+ run cp system/systemd/netdata.service "${SYSTEMD_DIRECTORY}/netdata.service" &&
run systemctl daemon-reload &&
${ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED} &&
return 0
@@ -848,7 +848,7 @@ install_netdata_logrotate() {
if [ "${UID}" -eq 0 ]; then
if [ -d /etc/logrotate.d ]; then
if [ ! -f /etc/logrotate.d/netdata ]; then
- run cp system/netdata.logrotate /etc/logrotate.d/netdata
+ run cp system/logrotate/netdata /etc/logrotate.d/netdata
fi
if [ -f /etc/logrotate.d/netdata ]; then
@@ -1076,8 +1076,8 @@ install_netdata_updater() {
fi
if issystemd && [ -n "$(get_systemd_service_dir)" ]; then
- cat "${NETDATA_SOURCE_DIR}/system/netdata-updater.timer" > "$(get_systemd_service_dir)/netdata-updater.timer"
- cat "${NETDATA_SOURCE_DIR}/system/netdata-updater.service" > "$(get_systemd_service_dir)/netdata-updater.service"
+ 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"
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/makeself/jobs/99-makeself.install.sh b/packaging/makeself/jobs/99-makeself.install.sh
index d29d0580a9..e5f300eb32 100755
--- a/packaging/makeself/jobs/99-makeself.install.sh
+++ b/packaging/makeself/jobs/99-makeself.install.sh
@@ -29,11 +29,7 @@ run cp \
packaging/makeself/install-or-update.sh \
packaging/installer/functions.sh \
configs.signatures \
- system/netdata-init-d \
- system/netdata-lsb \
- system/netdata-openrc \
- system/netdata.logrotate \
- system/netdata.service \
+ system/logrotate/netdata \
"${NETDATA_INSTALL_PATH}/system/"
# -----------------------------------------------------------------------------