나는 모든 것에 대해 잘 알지 못하지만 IMAP 서버에서 새 메일을 가져오기 위해 주기적으로 실행되는 다음 파일을 launchd
작성했습니다 .plist
offlineimap
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.dpo.offlineimap</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/offlineimap</string>
<string>-o</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProcessType</key>
<string>Background</string>
<key>StartInterval</key>
<integer>1800</integer>
</dict>
</plist>
파일은 에 있습니다 ~/Library/LaunchAgents/net.dpo.offlineimap.plist
.
문제는 컴퓨터를 절전 모드에서 깨울 때 프로세스가 깨어나지 않는 것 같다는 것입니다. 달리기
$ launchctl stop net.dpo.offlineimap
$ launchctl start net.dpo.offlineimap
다시 활성화하지만 KeepAlive
옵션이 무효화되는 것 같습니다.
나는 사용해 보았다.
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<true/>
<key>NetworkState</key>
<true/>
</dict>
하지만 나는 같은 행동을 관찰합니다. 저는 OSX 10.9를 사용하고 있습니다. 내 옵션 ~/.offlineimaprc
을 사용하지 않습니다 autorefresh
.
파일 에 문제가 있나요 plist
?
미리 감사드립니다!
답변1
글쎄요, 제가 의 의미를 오해하고 있는 것일 수도 있습니다 KeepAlive
. 그것은 밝혀홈브류작업을 수행하는 plist
파일 을 배포했습니다 .offlineimap
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>homebrew.mxcl.offline-imap</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/offline-imap/bin/offlineimap</string>
</array>
<key>StartInterval</key>
<integer>300</integer>
<key>RunAtLoad</key>
<true />
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
</dict>
</plist>
이제 데몬은 잠자기 상태에서 살아남습니다.