Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 175195 - Please move postgresql.conf to /etc
Summary: Please move postgresql.conf to /etc
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-19 10:08 UTC by Christoph Lange
Modified: 2011-02-08 18:31 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Lange 2007-04-19 10:08:54 UTC
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
Comment 1 Elvis Pranskevichus 2007-05-14 01:33:36 UTC
(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).
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2007-06-30 19:54:50 UTC
Everything's said in comment #1. Won't change this.
Comment 3 John Feuerstein 2011-02-08 17:49:50 UTC
Please reconsider moving the configuration files to /etc.

Placing configuration files in /var/lib breaks the FHS[1].
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[2]. Splitting configuration files from data files could be done like this:

Data:

  /var/lib/postgresql/<version>/<cluster>

Configs:

  /etc/postgresql/<version>/<cluster>

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.

Thanks!


[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBVARIABLESTATEINFORMATION

"Users must never need to modify files in /var/lib to configure a package's operation."

[2] http://www.postgresql.org/docs/9.0/interactive/runtime-config-file-locations.html

"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."
Comment 4 Aaron W. Swenson gentoo-dev 2011-02-08 18:31:46 UTC
Please don't submit rebuttals to dead bugs against a package no longer in the tree.

See bug 353687 instead.