1

I have dnsmasq available on my Android (stock ROM 4.4.2 Note2) and would like to know how I can tell if it's running and what settings its currently using?

1

If you're rooted, go to /system/bin/ and find dnsmasq if it's in there. Alternatively, you can also check /xbin (but, that's unlikely to be there).

If you managed to find one in either path - you now use a terminal emulator and type su first and enter, then type dnsmasq -d to see if the process will be invoked properly. It should also run with its default settings depending on how it was compiled.

0

I can't tell you exactly for the settings, but here's an approach that basically should work for any app:

What you will need

Either a app, or an connection to the device. Be able to work with the .

Alternatively, for parts of the tasks there are apps available to monitor system resources.

What to do

At the shell prompt, you can check for active processes using the ps command. You can filter the output using grep. Assuming you know the package name (you can find it in the app's Playstore URL, right after the id=), and let's say it's com.foobar:

ps | grep "com.foobar"

would either show all processes of the com.foobar app – or nothing (if it's not running).

As for the settings, that's not that easy to determine. Depending on the app, these are either stored in a database, in the apps "shared preferences", or in both – all those stored below /data/data/com.foobar in our example case, which only root or the app itself has access to.

So if the device is rooted, you could try to directly access the corresponding files in /data/data/com.foobar/database/* and /data/data/com.foobar/shared_prefs/*, and investigate the files – using SQLite3 (or one of its GUIs) for the database files, and some XML viewer for the shared preferences.

  • that doesn't work in this case, dnsmasq is not a typical installed app, it seems to have been supplied with the ROM. – warsong Dec 23 '14 at 17:45
  • If you know how the process calls itself, it works the very same way. Everything running a process shows up in ps. – Izzy Dec 23 '14 at 21:22
  • I've looked for it already using ps dnsmasq. Nothing showed up. – warsong Dec 24 '14 at 0:35
  • I have no idea how the process itself is named. While the application is DNSMasq, the process could e.g. be "dnsd". I'd take the full process list when I'm sure it's running, redirect that to a file (ps > ps.txt), and investigate that for what might be the one. I'm not sure whether the -f and -F parameters are available (full/extra full output) for additional details, but you might try. – Izzy Dec 24 '14 at 9:50
  • I've tried 'ps dns', 'ps dnsd', it's not showing up, I think I've tried all the obvious names. I have a feeling it's not working in which case, I probably need to do another question about how to get it running, because I don't know how/never tried before. – warsong Dec 26 '14 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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