launchctl list status 出现异常的解决方法

来源:互联网 发布:淘宝卖家欺骗消费者 编辑:程序博客网 时间:2024/06/04 18:22


从stackoverflow上转载一篇文章,讨论了在Mac OS中通过launchctl list发现plist运行的Status出现异常的解决方法,其实就是安装launchcontrol图形工具。

launchcontrol是一款强大的后台服务管理进程launchd辅助工具,能够帮助我们自定义并管理各种System/Global/UserAgents。可以查看程序的运行状态,是否出错,以及非常详细的出错提示信息。


what does launchd status 78 mean?? why my user agent not running??


up vote7down votefavorite
1

I want to run a unison sync service running in the background whenever I login. But the status code of my agent is 78. I don't know why, I tried some fix posted online, but it just doesn't work.

What's the problem?? below is the plist file for my service.

<?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>syncmyproject</string>    <key>StandardOutPath</key>    <string>/var/log/syncmyproject.log</string>    <key>StandardErrorPath</key>    <string>/var/log/syncmyproject.log</string>    <key>RunAtLoad</key>    <true/>    <key>KeepAlive</key>    <true/>    <key>Debug</key>    <true/>    <key>EnableGlobbing</key>    <true/>    <key>ProgramArguments</key>    <array>      <string>/usr/local/bin/unison</string>      <string>-auto</string>      <string>-batch</string>      <string>-repeat watch</string>      <string>~/home/project</string>      <string>~/project</string>    </array></dict></plist>
shareimprove this question
 
 
You can grep this file for possible clues as to what's wrong: /var/log/system.log – Nick Dec 1 at 19:52

2 Answers

activeoldestvotes
up vote11down voteaccepted

I read man launchctl, find 78 means function not implemented. It doesn't help much.

Finally I make it work, actually there were errors in the plist, I recommend to install the brew cask install launchcontrol, which is a gui tool for launchctl, it can help detect errors and trouble shooting.

shareimprove this answer
 
1 
Thanks for this. launchcontrol helped solve my issue. For the record I had status 78 and my issue was that my script did not start with an interpreter e,g; #!/bin/sh – getthemike Feb 26 at 14:37
 
For me the problem was, that the log directory was not accessible by the current user. – d4Rk Oct 25 at 10:16
转自:http://stackoverflow.com/questions/1101957/are-there-any-standard-exit-status-codes-in-linux
0 0
原创粉丝点击