swb-sys-monitor.service 767 B

1234567891011121314151617181920212223242526272829303132333435363738
  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=nogroup
  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:/proc/meminfo:/proc/sys/kernel/hostname
  24. # 资源限制
  25. LimitNOFILE=65536
  26. LimitNPROC=4096
  27. # 网络设置
  28. IPAddressDeny=any
  29. IPAddressAllow=localhost
  30. IPAddressAllow=127.0.0.1/8
  31. IPAddressAllow=::1/128
  32. [Install]
  33. WantedBy=multi-user.target