Rationale behind naming "dot d" (.d) directories
Ryan Schmidt
ryandesign at macports.org
Wed Apr 22 22:33:55 PDT 2009
On Apr 22, 2009, at 23:20, Jordan K. Hubbard wrote:
> On Apr 22, 2009, at 8:09 PM, Ryan Schmidt wrote:
>
>> Does anyone know the history behind the ".d" naming convention on
>> some directories?
>>
>> For example, /etc/rc.d or ${prefix}/etc/bash_completion.d. I seem
>> to understand how these directories are used, but what does the
>> ".d" mean?
>
> The history was pretty simple. When we had a file called /etc/foo,
> which we later to split into a directory full of individual one-
> entry-per-file records rather than the previous "all records in a
> single file", we would rename /etc/foo to /etc/foo.d to denote the
> switch.
Thanks for the explanation. That makes sense, as it avoids the
problems of an object with a given name changing from a file to a
directory from one release to the next.
The reason I ask is for a change I'm working on for the php5
extension ports. Currently, ports like php5-memcache just print a
message telling the user to add these lines to their php.ini:
extension_dir=/opt/local/lib/php/extensions/no-debug-non-zts-20060613
extension=memcache.so
But php can be configured to look for additional ini files in a
certain directory. So I would like to modify the php5 port to do
this, and then modify ports like php5-memcache to just install a file
like e.g. memcache.ini which contains these lines. Then the extension
will automatically be loaded and the user won't have to do it manually.
Currently, the php.ini is in /opt/local/etc. This is a little out in
the open and I would like to move it into a directory of its own,
probably named for the port, so, say, /opt/local/etc/php5. This would
also be a step toward allowing php4 and php5 (and a hypothetical
future php6) to be installed simultaneously which is desirable.
Now I need a directory in which php5 extension ports will install
their small additional .ini files. I don't think it should be the
same /opt/local/etc/php5 directory because php is set up to first
look for its one true php.ini and then load all the additional ini
files in a directory; this might cause php.ini to be parsed twice,
which is at best wasteful and at worst could cause problems. Order
may also be important so I would like to load php.ini first, then the
other files. So for the directory name, should I use /opt/local/etc/
php5.d? /opt/local/etc/php5/php.d? Or forget about the whole .d thing
and make it /opt/local/etc/php5/extra (which would be similar to /opt/
local/apache2/conf/extra)? Other suggestions?
> Don't forget, /etc/rc used to be a single file...
And indeed I wasn't looking: it *is* a single file, even on Leopard.
More information about the macports-dev
mailing list