swb-sys-monitor.service 794 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [Unit]
  2. Description=Resource Status Monitor
  3. Documentation=https://github.com/swaybien/swb-sys-monitor
  4. After=network.target
  5. Wants=network.target
  6. [Service]
  7. Type=simple
  8. User=nobody
  9. Group=nobody
  10. ExecStart=/usr/local/bin/swb-sys-monitor --log-level info
  11. ExecReload=/bin/kill -HUP $MAINPID
  12. Restart=always
  13. RestartSec=5
  14. StandardOutput=journal
  15. StandardError=journal
  16. SyslogIdentifier=swb-sys-monitor
  17. # 安全设置
  18. NoNewPrivileges=true
  19. PrivateTmp=true
  20. ProtectSystem=strict
  21. ProtectHome=true
  22. ReadWritePaths=/var/log
  23. ReadOnlyPaths=/proc/stat
  24. ReadOnlyPaths=/proc/meminfo
  25. ReadOnlyPaths=/proc/sys/kernel/hostname
  26. # 资源限制
  27. LimitNOFILE=65536
  28. LimitNPROC=4096
  29. # 网络设置
  30. IPAddressDeny=any
  31. IPAddressAllow=localhost
  32. IPAddressAllow=127.0.0.1/8
  33. IPAddressAllow=::1/128
  34. [Install]
  35. WantedBy=multi-user.target