You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已启用的systemd timer处于inactive状态且无时间信息的问题解决求助

已启用的systemd timer处于inactive状态且无时间信息的问题解决求助

大家好,我最近配置了一个systemd定时器和对应的服务,用来定时录制教会的线上直播,但遇到了奇怪的问题,想请教下各位怎么解决。

我先把自己的操作流程和配置内容整理出来:

  1. 先将服务和定时器文件安装到systemd的系统目录:
$ sudo install -vpm 644 ncc-record.* /usr/local/lib/systemd/system/
'ncc-record.service' -> '/usr/local/lib/systemd/system/ncc-record.service'
'ncc-record.timer' -> '/usr/local/lib/systemd/system/ncc-record.timer'
  1. 重新加载systemd的配置:
$ sudo systemctl daemon-reload
  1. 查看服务和定时器的具体配置内容:
$ systemctl cat ncc-record.*
# /usr/local/lib/systemd/system/ncc-record.service
[Unit]
Description=Record the New Creation Church Live sermon
After=network-online.target

[Service]
Type=oneshot
User=sebastien
Group=sebastien
#UMask=026
ExecStart=/home/sebastien/myScripts/shl/record_NCC_Live_Then_Suspend.sh

# /usr/local/lib/systemd/system/ncc-record.timer
[Unit]
Description=Trigger the service record.service

[Timer]
OnCalendar=Sun *-*-* 11:29:30

[Install]
WantedBy=timers.target
  1. 启用定时器:
$ sudo systemctl enable ncc-record.timer
Created symlink /etc/systemd/system/timers.target.wants/ncc-record.timer → /usr/local/lib/systemd/system/ncc-record.timer.

但操作完成后,问题出现了:

  • 执行systemctl list-timers | grep ncc时,完全找不到这个定时器,说明它不在活跃定时器列表里;
  • 查看非活跃定时器时,这个定时器的所有时间字段(NEXT、LEFT、LAST、PASSED)全是n/a:
$ systemctl list-timers --state=inactive | grep ncc
n/a                          n/a           n/a                          n/a           ncc-record.timer               ncc-record.service

有没有大佬能帮我排查下这是哪里出了问题,该怎么修复这个定时器呢?

备注:内容来源于stack exchange,提问作者SebMa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 09:03:09