Currently, PostgreSQL's configuration file is /var/lib/postgresql/data/postgresql.conf. I'd suggest that it should be moved where is belongs, i.e. to some subdirectory of /etc like /etc/postgresql. Cf. the recent Tomcat ebuilds that also change Tomcat's default directory layout for a better compliance with Gentoo's layout.
Steps to Reproduce:
(does not apply)
Config file is in /var/lib/postgresql/data/postgresql.conf
Config file should be somewhere like /etc/postgresql/postgresql.conf
(In reply to comment #0)
> Currently, PostgreSQL's configuration file is
> /var/lib/postgresql/data/postgresql.conf. I'd suggest that it should be moved
> where is belongs, i.e. to some subdirectory of /etc like /etc/postgresql. Cf.
> the recent Tomcat ebuilds that also change Tomcat's default directory layout
> for a better compliance with Gentoo's layout.
> Reproducible: Always
> Steps to Reproduce:
> (does not apply)
> Actual Results:
> Config file is in /var/lib/postgresql/data/postgresql.conf
> Expected Results:
> Config file should be somewhere like /etc/postgresql/postgresql.conf
Well, no. The configuration file is per database cluster. Which is by default /var/lib/postgresql/data. And you can run multiple instances of the server with different clusters. There is no such thing as global postgresql config (well, except /etc/conf.d/postgresql which is another story).
Everything's said in comment #1. Won't change this.
Please reconsider moving the configuration files to /etc.
Placing configuration files in /var/lib breaks the FHS.
People putting /etc under version control are unable to track config changes.
People creating backups of /etc to secure host configuration are doomed.
While I understand the problem Elvis described, it is trivial to solve this within /etc/postgresql just like it's done in the default prefixed /var/lib/postgresql.
For example, other distributions do something similar which is even supported by upstream. Splitting configuration files from data files could be done like this:
PGDATA is set to /etc/postgresql/<version>/<cluster>, while the shipped postgresql.conf sets data_directory to /var/lib/postgresql/<version>/<cluster>.
If someone runs multiple instances or re-uses configs for other clusters, the situation is identical to what we have with the config files sitting in the data directory... except that we could get rid of all the annoying downsides listed above.
"Users must never need to modify files in /var/lib to configure a package's operation."
"If you wish to keep the configuration files elsewhere than the data directory, the postgres -D command-line option or PGDATA environment variable must point to the directory containing the configuration files, and the data_directory parameter must be set in postgresql.conf (or on the command line) to show where the data directory is actually located. Notice that data_directory overrides -D and PGDATA for the location of the data directory, but not for the location of the configuration files."
Please don't submit rebuttals to dead bugs against a package no longer in the tree.
See bug 353687 instead.