外置硬盘上的任何脚本都无法用 launchctl load

2023-01-09 18:07:58 +08:00
 blackcurrant
me@mac /Volumes/T7Shield/test$ ls
testdaemon.plist testdaemon.sh

me@mac /Volumes/T7Shield/test$ launchctl load testdaemon.plist
Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors.

me@mac /Volumes/T7Shield/test$ plutil testdaemon.plist
testdaemon.plist: OK

如果把脚本移动到系统盘就能正常 load, 有人知道如何解决吗?

932 次点击
所在节点    macOS
3 条回复
churchmice
2023-01-09 18:09:04 +08:00
Try running `launchctl bootstrap` as root for richer errors.
neilyoone
2023-01-09 19:26:00 +08:00
Try running `launchctl bootstrap` as root for richer errors.
blackcurrant
2023-01-09 20:06:33 +08:00
```
mac@mac /Volumes/T7Shield/test$ launchctl bootstrap gui/501 testdaemon.plist
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.

me@mac /Volumes/T7Shield/test$ sudo launchctl bootstrap gui/501 testdaemon.plist

me@mac /Volumes/T7Shield/test$ launchctl list|grep test
- 78 testdaemon

me@mac /Volumes/T7Shield/test$ sudo launchctl kickstart -k gui/501/testdaemon

me@mac /Volumes/T7Shield/test$ ps -ef|grep test
501 20046 7610 0 8:02PM ttys005 0:00.00 grep --color=always test
```

用 sudo launchctl bootstrap 似乎能够载入,但是并没有运行。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/907687

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX