[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: links to logs in /etc? (/etc/postgresql/7.4/main/log)


Erik Steffl [2005-06-12 16:25 -0700]:
>   why is there a link to logs in /etc?
>   /etc/postgresql/7.4/main/log is a link to 
> /var/log/postgresql/postgresql-7.4-main.log

The basic idea of the new cluster system was to have the complete
information about a cluster's files in
/etc/postgresql/<version>/<cluster>. That includes the location of the
log files and the data directory, which are configured using these
symlinks to their actual position.

This makes it possible to move around clusters, rename them, or even
have several postmasters log to the same file without assuming any
preferred log file name in the infrastructure. 

>   /etc is supposed to be for configuration files that are static, the 
> link to log violates both (yes, it's only a link so it doesn't change 
> but points to a file that changes and is definetely not a configuration 
> file).

As you just said yourself, the link itself does not change, so it _is_
a static file. Its target is meant to be a piece of configuration
which is user-changeable. As other people pointed out, it is
equivalent to a link in /etc/alternative or an option in a real
configuration file, so I don't see any problem with violating the
spirit and the letters of the Debian Policy. The DP does not say that
log files may never be moved around.

>   is this a bug? Or is this somehow valid?

It is not a bug in the sense of an unexpected behavior.
pg_createcluster was specifically designed that way.

>   btw I am not sure which package is this part of, can't find it using 
> dpkg -S, not even when I dpkg -L all postgresql packages I have 
> installed (I guess it was created by postinst sript or something like that).

It is not a conffile, none of the files below /etc/postgresql is.
These files are created by pg_createcluster and are properly cleaned
in the respective postrm scripts.

I still think this architecture is a good idea. It is technically
possible to do without the symlinks and hardcode log file paths into
the wrapper scripts. But it would just drop some nice features without
actually gaining anything. So if you want to have that changed, you
really have to convince me that symlinks in /etc are evil and worse
than a config file option.

Thanks and have a nice day,


Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

Attachment: signature.asc
Description: Digital signature

Reply to: