Classically, a Unix program can look for control information in
five places in its startup-time environment:
These queries are usually done in the order listed above. That
way, later (more local) settings override earlier (more global)
ones. Settings found earlier can help the program compute locations
for later retrievals of configuration data.
When thinking about which mechanism to use to pass configuration
data to a program, bear in mind that good Unix practice demands using
whichever one most closely matches the expected lifetime of the
preference. Thus: for preferences which are very likely to change
between invocations, use command-line switches. For preferences which
change seldom, but that should be under individual user control, use
a run-control file in the user's home directory. For preference
information that needs to be set site-wide by a system administrator
changed by users, use a run-control file
in system space.
We'll discuss each of these places in more detail, then examine
some case studies.