Systemd x.timer 拒绝启动

Systemd x.timer 拒绝启动

我正在尝试这样做:https://www.shivering-isles.com/lets-encrypt-renew-all-your-certs-using-systemd/

当我运行计时器时:

sudo systemctl start letsencrypt.timer

我收到错误:

Job for letsencrypt.timerfailed. See "systemctl status letsencrypt.timer" and "journlctl -xe" for details.

sudo journalctl -u letsencrypt.timer

-- Logs begin at Sat 2017-02-25 05:28:36 UTC, end at Fri 2017-03-03 15:18:23 
Mar 03 14:54:17 instanty-dev systemd[1]: letsencrypt.timer: Refusing to start
Mar 03 14:54:17 instanty-dev systemd[1]: Failed to start letsencrypt timer.

letsencrypt.service

[Unit]
Description=Renews letsencrypt certificates  
After=network.target

[Service]
Type=oneshot  
WorkingDirectory=/opt/letsencrypt/  
ExecStart=/opt/letsencrypt/letsencrypt-auto renew  

letsencrypt.timer

[Unit]
Description=letsencrypt timer

[Timer]
OnCalendar=daily  
Persistent=true  
Unit=letsencrypt.service

[Install]
WantedBy=basic.target

答案1

通过查看systemd源代码,计时器发出“拒绝启动”的唯一原因是它需要激活的服务单元出现问题。确认.timer.service文件均有效:

systemd-analyze verify /etc/systemd/system/letsencrypt.service
systemd-analyze verify /etc/systemd/system/letsencrypt.timer

还要确认您可以手动启动 letsencrypt 服务:

systemctl start letsencrypt
journalctl -u letsencrypt

相关内容