在 这个帖子 下有位佬给我提供了灵感,既然空闲会关机,那让其不空闲不就行了
注意:此方法暂未验证有效性,仅通过合理性猜测
安装 stress-ng 工具
apt update && apt install stress-ng -y
创建服务脚本 /etc/systemd/system/stress-ng-load.service
[Unit]
Description=Stress-ng CPU 15% Load Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/stress-ng --cpu 1 --cpu-load 15
Restart=always
RestartSec=3s
[Install]
WantedBy=multi-user.target
然后启动
systemctl daemon-reload
systemctl enable --now stress-ng-load
7
12
12 条回复
排序