wfa*_*ulk 14
Steve Folly 的链接是准确的,但要在这里提供:
在 /Library/LaunchDaemons 中创建一个名为 com.domain.identifier.plist 的 plist 文件(它只是一个纯文本 XML 文档),其内容类似于:
<!DOCTYPE plist PUBLIC "-//Apple//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>com.domain.identifier</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/kextload</string>
<string>/System/Library/Extensions/MyExtension.kext</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
(有一个手册页,launchd.plist(5),它指定了 LaunchDaemon plist 文件的语法。)
然后我将其转换为二进制 plist 文件,仅用于一些简单的语法检查:
plutil -convert binary1 com.domain.identifier.plist
Run Code Online (Sandbox Code Playgroud)
然后激活 LaunchDaemon 在启动时运行:
launchctl load -w /Library/LaunchDaemons/com.domain.identifier.plist
Run Code Online (Sandbox Code Playgroud)
并检查以确保它在那里:
launchctl list | grep com.domain.identifier
Run Code Online (Sandbox Code Playgroud)
LaunchDaemon 应该在启动时运行并加载 kext。
| 归档时间: |
|
| 查看次数: |
14426 次 |
| 最近记录: |