【问题标题】:Where is dnsmasq.conf in Android phone?Android手机中的dnsmasq.conf在哪里?
【发布时间】:2013-01-17 01:28:43
【问题描述】:
在Android的命令行中,有dnsmasq命令。但是所有的配置文件(dnsmasq.conf、dnsmasq.pid...)在哪里?
就我而言,我尝试创建自己的配置文件并使用以下命令:
dnsmasq --conf-file=the/location/of/my/file
上面写着:
dnsmasq: 无法打开 pidfile /var/run/dnsmasq.pid: 没有那个文件或目录
当我创建 pid 文件时它说:
dnsmasq: 无法打开 pidfile dnsmasq.pid: 只读文件系统
关于如何控制我的 dnsmasq(DHCP、DNS 服务器)有什么建议吗?
【问题讨论】:
标签:
android
android-intent
dnsmasq
【解决方案1】:
调试模式(-d 或 --no-daemon)通过不分叉来避免对 pid 文件的需要,如果有帮助的话。
更新:--pid-file 不带参数看起来是避免需要 pid 文件的更好方法。
【解决方案2】:
听起来您应该以 root 身份运行它来克服后一个问题。至于前一个问题,我还不清楚。一种解决方法可能是使用脚本启动 dnsmasq,通过命令行传递配置。
【解决方案3】:
为了存储它的进程 ID,dnsmasq 需要一个 pid 文件。因此,它需要正确的权限才能编写它。
您应该在系统的某个位置创建一个名为dnsmasq.pid 的文件,然后使用dnsmasq --pid-file <path/to/your/dnsmasq.pid> 将其提供给dnsmasq。请确保dnsmasq 有权访问此文件。
【解决方案4】:
它通常在 /system/etc 或只是 /etc 和
尝试通过-d或--no-daemon控件运行dnsmasq以避免pid文件错误。