4

In the command line of Android, there are dnsmasq commands. But where are all the config files (dnsmasq.conf, dnsmasq.pid...)?

As far as I try is creating my own configuration files and using the following command:

dnsmasq --conf-file=the/location/of/my/file

It says:

dnsmasq: failed to open pidfile /var/run/dnsmasq.pid: No such file or directory

When I create pid file it says:

dnsmasq: failed to open pidfile dnsmasq.pid: Read-only file system

Any recommendations on how I can control my dnsmasq (DHCP, DNS server)?

4 Answers 4

3

Debug mode (-d or --no-daemon) avoids the need for the pid file by not forking, if that helps.

Update: --pid-file with no arguments looks like a nicer way of avoiding the need for a pid file.

0

Sounds like you should probably run it as root to overcome the latter problem. As for the former problem, I have no idea yet. A workaround might be to start dnsmasq with a script, passing config via command line.

0

In order to store its process-id, dnsmasq requires a pid file. It therefore requires the right permissions to write it.

You should just create a file called dnsmasq.pid, somewhere on your system, and give it to dnsmasq using dnsmasq --pid-file <path/to/your/dnsmasq.pid>. Be sure that dnsmasq has the rights to access this file.

0

It's normally on /system/etc or just /etc and Try to run dnsmasq via -d or --no-daemon control to avoid the pid file error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.