Chapter 10. Files
84
10.7.5 User configuration files ( dotfiles )
The files in
/etc/skel
will automatically be copied into new user accounts by
adduser
. No
other program should reference the files in
/etc/skel
.
Therefore, if a program needs a dotfile to exist in advance in
$HOME
to work sensibly, that
dotfile should be installed in
/etc/skel
and treated as a configuration file.
However, programs that require dotfiles in order to operate sensibly are a bad thing, unless
they do create the dotfiles themselves automatically.
Furthermore, programs should be configured by the Debian default installation to behave as
closely to the upstream default behaviour as possible.
Therefore, if a program in a Debian package needs to be configured in some way in order to
operate sensibly, that should be done using a site wide configuration file placed in
/etc
. Only
if the program doesn't support a site wide default configuration and the package maintainer
doesn't have time to add it may a default per user file be placed in
/etc/skel
.
/etc/skel
should be as empty as we can make it. This is particularly true because there is no
easy (or necessarily desirable) mechanism for ensuring that the appropriate dotfiles are copied
into the accounts of existing users when a package is installed.
10.8 Log files
Log files should usually be named
/var/log/
package
.log
. If you have many log files, or
need a separate directory for permission reasons (
/var/log
is writable only by
root
), you
should usually create a directory named
/var/log/
package
and place your log files there.
Log files must be rotated occasionally so that they don't grow indefinitely; the best way to do
this is to drop a log rotation configuration file into the directory
/etc/logrotate.d
and use
the facilities provided by logrotate.
7
Here is a good example for a logrotate config file (for more
information see
logrotate(8)
):
/var/log/foo/*.log {
rotate 12
weekly
compress
postrotate
/etc/init.d/foo force reload
endscript
}
7
The traditional approach to log files has been to set up ad hoc log rotation schemes using simple shell scripts
and cron. While this approach is highly customizable, it requires quite a lot of sysadmin work. Even though the
original Debian system helped a little by automatically installing a system which can be used as a template, this
was deemed not enough. The use of
logrotate
, a program developed by Red Hat, is better, as it centralizes log
management. It has both a configuration file (
/etc/logrotate.conf
) and a directory where packages can drop
their individual log rotation configurations (
/etc/logrotate.d
).
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved