View previous topic :: View next topic |
Author |
Message |
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Mon Jun 19, 2006 5:42 pm Post subject: [solved]logrotate |
|
|
Quote: |
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.2 2004/07/18 01:58:24 dragonheart Exp $
#
# Logrotate default configuration file for Gentoo Linux
#
# See "man logrotate" for details
# rotate log files weekly
weekly
#daily
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
# packages can drop log rotation information into this directory
include /etc/logrotate.d
notifempty
nomail
noolddir
# no packages own lastlog or wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
|
two small, stupid questions,
what is comporessing, hat's it's use, what's the difference
what's rotating
and what are those names:
Quote: |
notifempty
nomail
noolddir
|
_________________ IK BEN GEK
Last edited by blommethomas on Sun Jun 25, 2006 1:19 pm; edited 1 time in total |
|
Back to top |
|
|
hensan l33t
Joined: 26 Jun 2003 Posts: 868 Location: Sweden
|
Posted: Mon Jun 19, 2006 6:07 pm Post subject: |
|
|
Compressing means that the logs are gzipped when they are rotated
Rotating means that a logfile is moved aside and a new one is created. The oldest rotated log is deleted.
As for the three functions:
config file wrote: | See "man logrotate" for details |
|
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Mon Jun 19, 2006 6:13 pm Post subject: |
|
|
Moved from Portage & Programming to Other Things Gentoo.
have a google: http://gentoo-wiki.com/HOWTO_Setup_Logrotate _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Mon Jun 19, 2006 6:20 pm Post subject: |
|
|
if you specify mail address,
it automatically mails to address whenever you specify mail? _________________ IK BEN GEK |
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Mon Jun 19, 2006 6:22 pm Post subject: |
|
|
is it safe to remove all logs in /var and start all over again with configuring logrotate and syslog?
most of my logs aren't written to since 7 months ago so... _________________ IK BEN GEK |
|
Back to top |
|
|
hensan l33t
Joined: 26 Jun 2003 Posts: 868 Location: Sweden
|
Posted: Mon Jun 19, 2006 11:18 pm Post subject: |
|
|
blommethomas wrote: | if you specify mail address,
it automatically mails to address whenever you specify mail? |
It can mail you either the newest or the oldest log, provided that you have set up a working mail client for it to use.
blommethomas wrote: | is it safe to remove all logs in /var and start all over again with configuring logrotate and syslog?
most of my logs aren't written to since 7 months ago so... |
Yes, the files in /var/log are safe to delete. |
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Tue Jun 20, 2006 5:35 am Post subject: |
|
|
I think I've set up a mail client in the past but how can I be sure?
for normal mail I use the Internet service of gmail but I can get it through mozilla thunderbird too _________________ IK BEN GEK |
|
Back to top |
|
|
hensan l33t
Joined: 26 Jun 2003 Posts: 868 Location: Sweden
|
Posted: Tue Jun 20, 2006 9:54 am Post subject: |
|
|
I think you need something like mail-client/mailx for it to work (Might work with some of the other command line mail clients as well).
logrotate manpage wrote: | -mmail <command>
Tells logrotate which command to use when mailing logs. This command should accept two arguments: 1) the subject
of the message, and 2) the recipient. The command must then read a message on standard input and mail it to the
recipient. The default mail command is /bin/mail -s.
|
|
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Tue Jun 20, 2006 2:13 pm Post subject: |
|
|
after having emptied /var/log, mysql doesn't start up anymore
and my apache can't write logs anymore, although both of them complazin of files not even in /var/log, did I remove symbolic links or something?
how can I get the log of my startup so I can give you the exact error message? _________________ IK BEN GEK |
|
Back to top |
|
|
nevynxxx Veteran
Joined: 12 Nov 2003 Posts: 1123 Location: Manchester - UK
|
Posted: Tue Jun 20, 2006 2:40 pm Post subject: |
|
|
You probably removed directories.......
You can remove the files, but leave the directories where they are.... _________________ My Public Key
Wanted: Instructor in the art of Bowyery |
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Tue Jun 20, 2006 3:29 pm Post subject: |
|
|
any idea what the normal directories are that are in /var/log? _________________ IK BEN GEK |
|
Back to top |
|
|
nephros Advocate
Joined: 07 Feb 2003 Posts: 2139 Location: Graz, Austria (Europe - no kangaroos.)
|
Posted: Tue Jun 20, 2006 4:34 pm Post subject: |
|
|
blommethomas wrote: | any idea what the normal directories are that are in /var/log? |
Depends on the software you have installed.
/var/log is owned by root, so only root processes can create fles in there.
As most services (like bind) are run as their own special users, they can't write directly to /var/log, therefore you must create directories and chown them to the appropriate users (and sometimes group).
For example, portage it has the following permissions:
drwxrws--- 3 portage portage 277480 2006-06-20 08:44 portage _________________ Please put [SOLVED] in your topic if you are a moron. |
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Tue Jun 20, 2006 4:49 pm Post subject: |
|
|
apache is a program which needs log files in /var/log/apache2, I recreated the directory but I'm not sure if the files will be remade. Further I suppose there are some general directories to like critical, cron, can someone give me confirmation.
Is there a way to regain the standard logs? _________________ IK BEN GEK |
|
Back to top |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Tue Jun 20, 2006 7:17 pm Post subject: |
|
|
blommethomas wrote: | apache is a program which needs log files in /var/log/apache2, I recreated the directory but I'm not sure if the files will be remade. Further I suppose there are some general directories to like critical, cron, can someone give me confirmation.
Is there a way to regain the standard logs? |
Q1: yes they will, if access rights to the folder allow that of course
Q2: no, if you want more detailed differentation then the default 'per program' and what the apps do themself (e.g. apache having at least access_log + error_log) you need to configure this yourself
Q3: not sure what you mean _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
|
blommethomas Apprentice
Joined: 16 Nov 2005 Posts: 285 Location: roeselare, belgium
|
Posted: Wed Jun 21, 2006 5:28 am Post subject: |
|
|
so normally apache2 should remake the logs itself if they have the right rights? _________________ IK BEN GEK |
|
Back to top |
|
|
|