~/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
/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