5

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)?

JonasVautherin
  • 7,297
  • 6
  • 49
  • 95
TrisNguyen
  • 591
  • 3
  • 8
  • 15

4 Answers4

4

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.

lane
  • 633
  • 12
  • 18
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.

Mark K Cowan
  • 1,755
  • 1
  • 20
  • 28
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.

JonasVautherin
  • 7,297
  • 6
  • 49
  • 95
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.

Richard Sitze
  • 8,262
  • 3
  • 36
  • 48