Am 11.10.2012 14:41, schrieb Marti Raudsepp: > On Thu, Oct 11, 2012 at 2:26 PM, Thomas Bächler <[email protected]> wrote: >> 1) >> postgresql expects its configuration files in /usr/etc/postgresql/. It >> doesn't install any files there by default, so namcap doesn't notice - >> however, you can copy the sample files from /usr/share/postgresql to >> this location. This must be fixed by appending --sysconfdir=/etc to the >> configure options. > > I think you're wrong about this. PostgreSQL, by default, does not > store config files in /etc (or sysconfdir) at all. Configuration files > are stored along with everything else in PGDATA > (/var/lib/postgres/data)... > > % sudo -u postgres strace -eopen postgres -D /var/lib/postgres/data > 2>/tmp/strace.out > [...] > ^C > % egrep '(etc|conf)' /tmp/strace.out > > open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 > open("/var/lib/postgres/data/postgresql.conf", O_RDONLY) = 3 > open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3 > open("/etc/host.conf", O_RDONLY|O_CLOEXEC) = 3 > open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3 > open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 > open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3 > open("/etc/gai.conf", O_RDONLY|O_CLOEXEC) = 3 > open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 8 > open("/var/lib/postgres/data/pg_hba.conf", O_RDONLY) = 9 > open("/var/lib/postgres/data/pg_ident.conf", O_RDONLY) = 9 > > No attempted accesses to /usr/etc. > > Regards, > Marti
You may be correct, but SYSCONFDIR (defaulting to /usr/etc) is used in some places at least in the client. This doesn't seem to affect postgresql.conf apparently, as I originally assumed. In general, strace -e open is insufficient for such tests, as virtually all programs will stat() a file before trying to open() it. When proving a file is not being checked, add the stat system call, too.
signature.asc
Description: OpenPGP digital signature

