| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- [Unit]
- Description=Resource Status Monitor
- Documentation=https://github.com/swaybien/swb-sys-monitor
- After=network.target
- Wants=network.target
- [Service]
- Type=simple
- User=nobody
- Group=nobody
- ExecStart=/usr/local/bin/swb-sys-monitor --log-level info
- ExecReload=/bin/kill -HUP $MAINPID
- Restart=always
- RestartSec=5
- StandardOutput=journal
- StandardError=journal
- SyslogIdentifier=swb-sys-monitor
- # 安全设置
- NoNewPrivileges=true
- PrivateTmp=true
- ProtectSystem=strict
- ProtectHome=true
- ReadWritePaths=/var/log
- ReadOnlyPaths=/proc/stat
- ReadOnlyPaths=/proc/meminfo
- ReadOnlyPaths=/proc/sys/kernel/hostname
- # 资源限制
- LimitNOFILE=65536
- LimitNPROC=4096
- # 网络设置
- IPAddressDeny=any
- IPAddressAllow=localhost
- IPAddressAllow=127.0.0.1/8
- IPAddressAllow=::1/128
- [Install]
- WantedBy=multi-user.target
|