summaryrefslogtreecommitdiffstats
path: root/system/netdata.service.v235.in
diff options
context:
space:
mode:
authorAmish <3330468+amishmm@users.noreply.github.com>2020-01-30 03:45:32 +0530
committerGitHub <noreply@github.com>2020-01-30 08:15:32 +1000
commit2979efe03161499e9a53f76d843c2fd7e5006a92 (patch)
treefdb94096c30a18fa6405a1c8e44f18db2395ad12 /system/netdata.service.v235.in
parentf5a043ce21642a68c7bef7363163d308edd97074 (diff)
Better systemd service file (#7790)
* Provide a new service file for systemd v235+ Let systemd create directories, instead of via ExecStartPre. * Do not set global options in service file via -W option. The default set by service file are anyway the defaults used by netdata. Better place is to mention them in netdata.conf and allow user to change those options via netdata.conf file instead of changing in service file.
Diffstat (limited to 'system/netdata.service.v235.in')
-rw-r--r--system/netdata.service.v235.in48
1 files changed, 48 insertions, 0 deletions
diff --git a/system/netdata.service.v235.in b/system/netdata.service.v235.in
new file mode 100644
index 0000000000..303acb17c1
--- /dev/null
+++ b/system/netdata.service.v235.in
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+[Unit]
+Description=Real time performance monitoring
+
+# append here other services you want netdata to wait for them to start
+After=network.target httpd.service squid.service nfs-server.service mysqld.service mysql.service named.service postfix.service chronyd.service
+
+[Service]
+Type=simple
+User=netdata
+Group=netdata
+RuntimeDirectory=netdata
+CacheDirectory=netdata
+StateDirectory=netdata
+LogsDirectory=netdata
+RuntimeDirectoryMode=0775
+StateDirectoryMode=0750
+CacheDirectoryMode=0750
+LogsDirectoryMode=0750
+PIDFile=netdata/netdata.pid
+ExecStart=@sbindir_POST@/netdata -P $PIDFILE -D
+
+# saving a big db on slow disks may need some time
+TimeoutStopSec=60
+
+# restart netdata if it crashes
+Restart=on-failure
+RestartSec=30
+
+# The minimum netdata Out-Of-Memory (OOM) score.
+# netdata (via [global].OOM score in netdata.conf) can only increase the value set here.
+# To decrease it, set the minimum here and set the same or a higher value in netdata.conf.
+# Valid values: -1000 (never kill netdata) to 1000 (always kill netdata).
+OOMScoreAdjust=1000
+
+# Valid policies: other (the system default) | batch | idle | fifo | rr
+# To give netdata the max priority, set CPUSchedulingPolicy=rr and CPUSchedulingPriority=99
+CPUSchedulingPolicy=idle
+
+# This sets the scheduling priority (for policies: rr and fifo).
+# Priority gets values 1 (lowest) to 99 (highest).
+#CPUSchedulingPriority=1
+
+# For scheduling policy 'other' and 'batch', this sets the lowest niceness of netdata (-20 highest to 19 lowest).
+#Nice=0
+
+[Install]
+WantedBy=multi-user.target