Forgot the configuration file?

A common thing when you work with different linux distribution is to forget the locan of a specific configutation file, or you have compiled a service from source and don’t know where the “make install” process put the configuration files. Well, there are at least two methods to rememorize the path: first you write it down, second you use the “strings” command.

Strings is a command that will show all the strings from a file given as argument. Usualy the configuration files have a default path hardcoded in the source code and a comand line argument that will override the default one.

So, long story short:

razvan@robuhsrv001:~$ strings /usr/sbin/dhcpd | grep “dhcpd.conf”
/etc/dhcpd.conf
Please read the dhcpd.conf manual page %s
of the dhcpd.conf file.
in your dhcpd.conf file %s

razvan@robuhsrv001:~$ strings /usr/sbin/named | grep named
bind9_check_namedconf
cfg_type_namedconf
named.run
usage: named [-4|-6] [-c conffile] [-d debuglevel] [-f|-g] [-n number_of_cpus]
named version: BIND 9.4.3-P3 (Jul 29 2009)
/etc/named.conf
/var/run/named/named.pid
/var/run/named/lwresd.pid
named.stats
named_dump.db
named.recursing

Leave a comment

2 Comments.

  1. This is marginally useful. You shouldn’t compile stuff unless you commit to do regular updates. Use the packages provided by your distro! If you can’t help it use a SANE scheme (eg. all compiled stuff should have a /opt prefix so you don’t mix them). And don’t forget that if the app needs a config file it should be somewhere in /etc. find /etc -name “whatever” ;)

  2. You are right. But in the Slackware world things are different from a normal package-based distribution.

Leave a Reply


[ Ctrl + Enter ]