![타이머를 사용자로 사용하는 시스템화된 서비스](https://linux55.com/image/78390/%ED%83%80%EC%9D%B4%EB%A8%B8%EB%A5%BC%20%EC%82%AC%EC%9A%A9%EC%9E%90%EB%A1%9C%20%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94%20%EC%8B%9C%EC%8A%A4%ED%85%9C%ED%99%94%EB%90%9C%20%EC%84%9C%EB%B9%84%EC%8A%A4.png)
타이머가 있는 서비스를 작성하려고 합니다. 그러나 실행되지는 않습니다.
예@host/etc/systemd/system/mbsync.service:
[Unit]
Description=Mailbox synchronisation service for user example
[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -aV
User=example
StandardOutput=syslog
StandardError=syslog
예@host/etc/systemd/system/mbsync.timer:
[Unit]
Description=Mailbox synchronisation timer
[Timer]
OnBootSec=10s
OnCalendar=*:00/2
[Install]
WantedBy=default.target
저는 다음과 같이 서비스를 시작했습니다.
systemctl daemon-reload
systemctl enable mbsync.timer
systemctl start mbsync.timer
그러나 나는 단지 다음을 얻습니다:
systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2015-11-30 11:50:00 CET 10s ago Mon 2015-11-30 11:50:07 CET 2s ago mbsync.timer mbsync.service
답변1
너의 타이머예수행되었지만 아마도 기대에 미치지 못했을 것입니다. 로그를 확인 systemctl status -l mbsync.service
하고 이에 따라 로그를 조정해야 합니다 .mbsyncrc
.
다음 리소스가 도움이 되었습니다.
- https://wiki.archlinux.org/index.php/Isync#Automatic_synchronization
- https://www.bostonenginerd.com/posts/notmuch-of-a-mail-setup-part-1-mbsync-msmtp-and-systemd/
특히 두 번째는,사용자유닛 파일은 PassCmd "gpg ..."
.