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


从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??


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>
share improve 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

up vote 11 down vote accepted

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.

share improve 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值