~/Library/LaunchAgents Per-user agents provided by the user.
/Library/LaunchAgents Per-user agents provided by the administrator.
/Library/LaunchDaemons System-wide daemons provided by the administrator.
/System/Library/LaunchAgents Per-user agents provided by Mac OS X.
/System/Library/LaunchDaemons System-wide daemons provided by Mac OS X.
添加到 LaunchDaemons 中,服务启不来.
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.pdnsd.plist
sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.pdnsd.plist
sudo plutil -lint homebrew.mxcl.pdnsd.plist // 这个检查结果 ok
权限,所有者改了, 可执行程序也改了(pdnsd)
sudo chown root /Library/LaunchDaemons/homebrew.mxcl.pdnsd.plist
sudo chmod 644 /Library/LaunchDaemons/homebrew.mxcl.pdnsd.plist
plist 试了以下两种种,都不行:
<?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>Label</key>
<string>homebrew.mxcl.pdnsd</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/usr/local/sbin/pdnsd</string>
<key>ServiceDescription</key>
<string>pdnsd - a proxy DNS server with permanent caching</string>
</dict>
</plist>
******************************************************************************
<?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>homebrew.mxcl.pdnsd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/pdnsd</string>
<string>--daemon</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
但是
1. 手工启动可以: /usr/local/sbin/pdnsd --daemon, 使用也正常
2. dnsmasq 能正常启动:
<?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>Label</key>
<string>homebrew.mxcl.dnsmasq</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/dnsmasq</string>
<string>--keep-in-foreground</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
这到底是为什么? 我只是想通过 tcp 解析 dns
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/280728
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.