summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/Makefile.am1
-rwxr-xr-xsystem/install-service.sh.in14
-rw-r--r--system/systemd/50-netdata.preset1
3 files changed, 13 insertions, 3 deletions
diff --git a/system/Makefile.am b/system/Makefile.am
index 747c6d4e43..13466639d5 100644
--- a/system/Makefile.am
+++ b/system/Makefile.am
@@ -113,6 +113,7 @@ nodist_libsyssystemd_DATA = \
dist_libsyssystemd_DATA = \
systemd/netdata-updater.timer \
+ systemd/50-netdata.preset
$(NULL)
dist_noinst_DATA = \
diff --git a/system/install-service.sh.in b/system/install-service.sh.in
index 9a37528c54..a885a8618c 100755
--- a/system/install-service.sh.in
+++ b/system/install-service.sh.in
@@ -237,6 +237,8 @@ get_systemd_service_dir() {
install_systemd_service() {
SRCFILE="${SVC_SOURCE}/systemd/netdata.service"
+ PRESET_FILE="${SVC_SOURCE}/systemd/50-netdata.preset"
+ SVCDIR="$(get_systemd_service_dir)"
if [ "$(systemctl --version | head -n 1 | cut -f 2 -d ' ')" -le 235 ]; then
SRCFILE="${SVC_SOURCE}/systemd/netdata.service.v235"
@@ -255,18 +257,24 @@ install_systemd_service() {
fi
info "Installing systemd service..."
- if ! install -p -m 0644 -o 0 -g 0 "${SRCFILE}" "$(get_systemd_service_dir)/netdata.service"; then
+ if ! install -p -m 0644 -o 0 -g 0 "${SRCFILE}" "${SVCDIR}/netdata.service"; then
error "Failed to install systemd service file."
exit 4
fi
+ if [ -f "${PRESET_FILE}" ]; then
+ if ! install -p -m 0644 -o 0 -g 0 "${PRESET_FILE}" "${SVCDIR}-preset/50-netdata.preset"; then
+ warning "Failed to install netdata preset file."
+ fi
+ fi
+
if [ "$(check_systemd)" = "YES" ]; then
if ! systemctl daemon-reload; then
- warning "Failed to reload systemd unit files."
+ warning "Failed to reload systemd unit files."
fi
if ! systemctl "${ENABLE}" netdata; then
- warning "Failed to ${ENABLE} Netdata service."
+ warning "Failed to ${ENABLE} Netdata service."
fi
fi
}
diff --git a/system/systemd/50-netdata.preset b/system/systemd/50-netdata.preset
new file mode 100644
index 0000000000..fe4e5a1977
--- /dev/null
+++ b/system/systemd/50-netdata.preset
@@ -0,0 +1 @@
+enable netdata.service