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!
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!
This is 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 decide.
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
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.
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.