2

I have noticed some config files having a prefix. E.g. Inside my /etc/php5/cli/conf.d:

  • 05-opcache.ini
  • 10-pdo.ini
  • 20-curl.ini
  • ...

Could someone explain this? I am thinking something along the lines of file permissions or list order.

Thanks!

0

It's to do with order of inclusion (list order).

The config snippets will be iterated over one at a time to produce the full set of configuration options for the application.

By adding the numbers at the beginning of each filename it allows shell scripts (and other types of programs) to easily grab the directory listing and then process the scripts in the order you want.

Some other examples:

/etc/apt/apt.conf.d/
/etc/systcl.d/
/etc/rc*.d/
/etc/fonts/conf.avail/
/etc/fonts/conf.d/
/etc/udev/rules.d/

For some daemons the file permissions and/or the file extension may also determine if the file is included.

  • Is there a convention for the pairs? Is the whole range used (00-99)? Also, I am assuming the later will overwrite (if the case) the former (i.e. 90-foo.ini settings will overwrite 10-bar.ini settings). Right? – Robert T. Dec 12 '14 at 17:07
  • Generally the whole range is used. As far as what overrides what I think that is application dependant. If it is a shell script sourcing and processing the settings then I'd expect later config options to override earlier ones. – Troy Dec 14 '14 at 0:19
2

This is only used in multiple conf file environment, which are conventionaly appli.conf.d directories.

The order of inclusion depends on the alphabetical order.

So with a notation in 00 01..., the .conf files will be treated is the order you have in mind.

I don't think any other notation will be refused. But it may depend of the software using them.

So, the order of inclusion will be :

00-httpd.conf
01-cgi.conf
02-personnal.conf

But it could also be :

fipscheck.conf
nss-softokn-prelink.conf
0

See man run-parts It says, in part:

NAME
       run-parts - run scripts or programs in a directory

SYNOPSIS
       run-parts  [--test]  [--verbose]  [--report]  [--lsbsysinit]  [--regex=RE]  [--umask=umask]  [--arg=argument]  [--exit-on-error] [--help] [--version] [--list]
       [--reverse] [--] DIRECTORY

       run-parts -V

DESCRIPTION
       run-parts runs all the executable files named within constraints described    below, found in directory directory.  Other  files  and  directories  are  silently
       ignored.

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.