diff options
author | Grant Goodyear <g2boojum@gentoo.org> | 2002-09-23 00:30:51 +0000 |
---|---|---|
committer | Grant Goodyear <g2boojum@gentoo.org> | 2002-09-23 00:30:51 +0000 |
commit | d30b1bf1902e4d160d01e72edaae7506f4d8bb17 (patch) | |
tree | 54da51b74532f1138f30536fb497b8d596abb78a /app-admin/sysklogd | |
parent | Moved sysklogd to app-admin (diff) | |
download | gentoo-2-d30b1bf1902e4d160d01e72edaae7506f4d8bb17.tar.gz gentoo-2-d30b1bf1902e4d160d01e72edaae7506f4d8bb17.tar.bz2 gentoo-2-d30b1bf1902e4d160d01e72edaae7506f4d8bb17.zip |
Adding files. Oops.
Diffstat (limited to 'app-admin/sysklogd')
-rw-r--r-- | app-admin/sysklogd/files/syslog-cron | 32 | ||||
-rw-r--r-- | app-admin/sysklogd/files/syslog.conf | 75 | ||||
-rw-r--r-- | app-admin/sysklogd/files/syslogd-listfiles | 101 | ||||
-rw-r--r-- | app-admin/sysklogd/files/syslogd-listfiles.8 | 77 |
4 files changed, 285 insertions, 0 deletions
diff --git a/app-admin/sysklogd/files/syslog-cron b/app-admin/sysklogd/files/syslog-cron new file mode 100644 index 000000000000..bd0a3647c2fd --- /dev/null +++ b/app-admin/sysklogd/files/syslog-cron @@ -0,0 +1,32 @@ +#! /bin/sh + +# sysklogd Cron script to rotate system log files daily. +# +# If you want to rotate other logfiles daily, edit +# this script. An easy way is to add them manually +# or to add -a to syslogd-listfiles and add some grep +# stuff +# +# Written by Martin Schulze <joey@debian.org>. +# $Id: syslog-cron,v 1.1 2002/09/23 00:30:51 g2boojum Exp $ + +cd /var/log +for LOG in `syslogd-listfiles -a` +do + if [ -f $LOG ]; then + savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null + fi +done + +for LOG in `syslogd-listfiles --auth -a` +do + if [ -f $LOG ]; then + chown root.adm $LOG + chmod o-rwx $LOG + fi +done + +# Restart syslogd +# +/usr/bin/killall -HUP syslogd + diff --git a/app-admin/sysklogd/files/syslog.conf b/app-admin/sysklogd/files/syslog.conf new file mode 100644 index 000000000000..6b0ab2323ef1 --- /dev/null +++ b/app-admin/sysklogd/files/syslog.conf @@ -0,0 +1,75 @@ +# /etc/syslog.conf Configuration file for syslogd. +# +# For more information see syslog.conf(5) +# manpage. +# This is from Debian, we are using it for now +# Daniel Robbins, 5/15/99 + +# +# First some standard logfiles. Log by facility. +# + +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +#cron.* /var/log/cron.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* /var/log/mail.log +user.* -/var/log/user.log +uucp.* -/var/log/uucp.log +local6.debug /var/log/imapd.log + +# +# Logging for the mail system. Split it up so that +# it is easy to write scripts to parse these files. +# +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn +mail.err /var/log/mail.err + +# Logging for INN news system +# +news.crit /var/log/news/news.crit +news.err /var/log/news/news.err +news.notice -/var/log/news/news.notice + +# +# Some `catch-all' logfiles. +# +*.=debug;\ + auth,authpriv.none;\ + news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail,news.none -/var/log/messages + +# +# Emergencies are sent to everybody logged in. +# +*.emerg * + +# +# I like to have messages displayed on the console, but only on a virtual +# console I usually leave idle. +# +#daemon,mail.*;\ +# news.=crit;news.=err;news.=notice;\ +# *.=debug;*.=info;\ +# *.=notice;*.=warn /dev/tty8 + +# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, +# you must invoke `xconsole' with the `-file' option: +# +# $ xconsole -file /dev/xconsole [...] +# +# NOTE: adjust the list below, or you'll go crazy if you have a reasonably +# busy site.. +# +#daemon.*,mail.*;\ +# news.crit;news.err;news.notice;\ +# *.=debug;*.=info;\ +# *.=notice;*.=warn |/dev/xconsole + +local2.* -/var/log/ppp.log diff --git a/app-admin/sysklogd/files/syslogd-listfiles b/app-admin/sysklogd/files/syslogd-listfiles new file mode 100644 index 000000000000..68aca3ac01fc --- /dev/null +++ b/app-admin/sysklogd/files/syslogd-listfiles @@ -0,0 +1,101 @@ +#! /usr/bin/perl + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + +# Tue Jan 13 01:47:57 MET 1998: Martin Schulze <joey@infodrom.north.de> +# Fixed typo. +# +# Modified logfile detection routine to take care of double +# listed logfiles. It does this by using a hash instead of +# immediate printout. Thanks to Roman Hodek <roman@debian.org> +# for providing an appropriate patch. + +$conf = "/etc/syslog.conf"; +$opt_daily = 1; +$opt_all = 0; +$opt_auth = 0; +$opt_news = 0; + +sub usage +{ + print STDERR +" +Debian GNU/Linux syslogd-listfiles =VER=. Copyright (C) 1997 +Martin Schulze. This is free software; see the GNU General Public Licence +version 2 or later for copying conditions. There is NO warranty. + +Usage: syslogd-listfiles <options> +Options: -f file specifies another syslog.conf file + -a | --all list all files (including news) + --auth list all files containing auth.<some prio> + --news include news logfiles, too + -w | --weekly use weekly pattern instead of daily +"; +} + +while (@ARGV) { + $_=shift(@ARGV); + if (m/^-f$/) { + $conf = shift(@ARGV); + } elsif (m/^--weekly|-w$/) { + $opt_daily = 0; + } elsif (m/^(-a|--all)$/) { + $opt_all = 1; + } elsif (m/^--auth$/) { + $opt_auth = 1; + } elsif (m/^--news$/) { + $opt_news = 1; + } else { + &usage();exit (0); + } +} + +open (C, $conf) || die "Can't open $conf, $!"; +while (<C>) { + next if (/^(\#|$)/); + chop; + + s/\s*(\S.*)$/$1/ if ($line); + + $line .= $_; + chop ($line) if (/\\$/); + if (!/\\$/) { + $line =~ s/\s+/\t/; + $line =~ s/\t-/\t/; + push (@lines, $line) if ($line =~ /\t\/(?!dev\/)/); + $line = ""; + } +} +close (C); + +foreach $line (@lines) { + ($pat,$file) = split (/\t/,$line); + + # handled by news.daily from INN + next if (!$opt_news && ($pat =~ /news\.(crit|err|notice)/)); + + if ($opt_all) { + $output{$file} = 1; + } elsif ($opt_auth) { + $output{$file} = 1 if ($pat =~ /auth[^\.]*\.(?!none).*/); + } else { + $i = ($pat =~ /\*\.\*/); + $output{$file} = 1 if (($i && $opt_daily) || (!$i && !$opt_daily)); + } +} + +foreach $file (keys (%output)) { + print $file . "\n"; +} diff --git a/app-admin/sysklogd/files/syslogd-listfiles.8 b/app-admin/sysklogd/files/syslogd-listfiles.8 new file mode 100644 index 000000000000..9d63d1ce70f3 --- /dev/null +++ b/app-admin/sysklogd/files/syslogd-listfiles.8 @@ -0,0 +1,77 @@ +.\" syslogd-listfiles.8 - generic routine for /etc/syslog.conf +.\" Copyright (c) 1997 Martin Schulze <joey@debian.org> +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +.\" +.TH SYSLOGD-LISTFILES 8 "1 January 1998" "Debian project" "Debian GNU/Linux" +.SH NAME +syslogd-listfiles \- list system logfiles +.SH SYNOPSIS +.B syslogd-listfiles +.RB [ " \-a " | " \-\-all " ] +.RB [ " \-\-auth " ] +.RB [ " \-f " +.I config file +] +.RB [ " \-\-news " ] +.RB [ " \-w " | " \-\-weekly " ] +.SH DESCRIPTION +.B Sysklogd +provides a modern mechanism to log system messages. This mechanism is +controlled by the file +.IR /etc/syslog.conf . +Messages are divided into logfiles which can grow quite big. +Therefore the logfiles need to be rotated once per day, per week or +per month. On a Debian GNU/Linux system most of the files are rotated +once per week. + +This program helps the rotation script to determine which logfiles +need to be rotated and when. It takes care of news logfiles that are +handled by the +.B news.daily +script from INN. In conjunction with the scripts in +.IR /etc/cron.daily " and " /etc/cron.weekly +it takes care of files with sensitive information. + +By default a list of files for daily rotation is generated. At the +moment this option only reflects entries that contain "*.*" as +facility.priority. + +.SH OPTIONS +.TP +.BR "\-a" ", " "\-\-all" +List all logfiles and ignore all other rules. +.TP +.BI "\-f " "config file" +Specify an alternative configuration file instead of +.IR /etc/syslog.conf "," +which is the default. +.TP +.B "\-\-auth" +Only list files containing sensitive information such as the one +containing auth.*. +.TP +.B "\-\-news" +Don't exclude news logfiles which are normally handled by the +.B news.daily +script from INN. +.TP +.BR "\-w" ", " "\-\-weekly" +Generate the list for weekly rotation. +.LP +.SH SEE ALSO +.BR syslog.conf (5), +.BR syslogd (8), +.BR savelog (8). |