fix(systemd): 分析 timer 无效原因及解决方案

我看了下,这 timer 无效有几个原因
1. timer 本身要 enable 和 start
2. service 里要去掉 RemainAfterExit=yes 这条(不能让服务一直处于 activate)
3. timer 重新设计更新触发时间(6,12,18:00) 一天更新3次,分布到 30min 内
4. service 重新保持开机运行一次(撤回提交中的部分修改)

起码确定这不是服务器,不再 6h 分布,而是桌面系统,及时在到达时间后,在30min内完成更新(也同样不拥挤在一块),话说回来,到点后,在30分钟内统一更新所有安装了星火应用商店的机器,这用户量应该能支撑得住噻?
This commit is contained in:
2026-08-18 09:14:00 +08:00
parent 582435b857
commit b87112fa38
3 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -55,8 +55,8 @@ case "$1" in
# Start upgrade detect service # Start upgrade detect service
systemctl daemon-reload systemctl daemon-reload
# systemctl enable spark-update-notifier systemctl enable spark-update-notifier
# systemctl start spark-update-notifier systemctl start spark-update-notifier
# like apt-daily.timer # like apt-daily.timer
systemctl enable spark-update-notifier.timer systemctl enable spark-update-notifier.timer
@@ -4,7 +4,6 @@ After=apt-daily.service network.target network-online.target systemd-networkd.se
[Service] [Service]
Type=simple Type=simple
RemainAfterExit=yes
ExecStart=/opt/durapps/spark-store/bin/update-upgrade/ss-update-notifier.sh ExecStart=/opt/durapps/spark-store/bin/update-upgrade/ss-update-notifier.sh
Restart=on-failure Restart=on-failure
RestartSec=15 # 可以设置为更长的重试间隔,比如 15 秒或 30 秒 RestartSec=15 # 可以设置为更长的重试间隔,比如 15 秒或 30 秒
@@ -2,8 +2,8 @@
Description=Spark Store update notifier Description=Spark Store update notifier
[Timer] [Timer]
OnCalendar=*-*-* 6,18:00 OnCalendar=*-*-* 6,12,18:00
RandomizedDelaySec=12h RandomizedDelaySec=30m
Persistent=true Persistent=true
[Install] [Install]