netdata.service.in 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. [Unit]
  3. Description=Real time performance monitoring
  4. # append here other services you want netdata to wait for them to start
  5. After=network.target httpd.service squid.service nfs-server.service mysqld.service mysql.service named.service postfix.service chronyd.service
  6. [Service]
  7. Type=simple
  8. User=netdata
  9. Group=netdata
  10. RuntimeDirectory=netdata
  11. RuntimeDirectoryMode=0775
  12. PIDFile=@localstatedir_POST@/run/netdata/netdata.pid
  13. ExecStart=@sbindir_POST@/netdata -P @localstatedir_POST@/run/netdata/netdata.pid -D -W set global 'process scheduling policy' 'keep' -W set global 'OOM score' 'keep'
  14. ExecStartPre=/bin/mkdir -p @localstatedir_POST@/cache/netdata
  15. ExecStartPre=/bin/chown -R netdata:netdata @localstatedir_POST@/cache/netdata
  16. ExecStartPre=/bin/mkdir -p @localstatedir_POST@/run/netdata
  17. ExecStartPre=/bin/chown -R netdata:netdata @localstatedir_POST@/run/netdata
  18. #ExecStopPost=/bin/rm @localstatedir_POST@/run/netdata/netdata.pid
  19. PermissionsStartOnly=true
  20. # saving a big db on slow disks may need some time
  21. TimeoutStopSec=60
  22. # restart netdata if it crashes
  23. Restart=on-failure
  24. RestartSec=30
  25. # The minimum netdata Out-Of-Memory (OOM) score.
  26. # netdata (via [global].OOM score in netdata.conf) can only increase the value set here.
  27. # To decrease it, set the minimum here and set the same or a higher value in netdata.conf.
  28. # Valid values: -1000 (never kill netdata) to 1000 (always kill netdata).
  29. OOMScoreAdjust=1000
  30. # Valid policies: other (the system default) | batch | idle | fifo | rr
  31. # To give netdata the max priority, set CPUSchedulingPolicy=rr and CPUSchedulingPriority=99
  32. CPUSchedulingPolicy=idle
  33. # This sets the scheduling priority (for policies: rr and fifo).
  34. # Priority gets values 1 (lowest) to 99 (highest).
  35. #CPUSchedulingPriority=1
  36. # For scheduling policy 'other' and 'batch', this sets the lowest niceness of netdata (-20 highest to 19 lowest).
  37. #Nice=0
  38. [Install]
  39. WantedBy=multi-user.target