[Summary]: log rotation with logadm failing at gzip

From: Chris Hoogendyk <hoogendyk_at_bio.umass.edu>
Date: Tue Jun 21 2005 - 12:32:39 EDT
My apologies for not putting an appropriate title on my original 
message, which was titled: [Fwd: Output from "cron" command]

and Thanks to those who replied: Crist Clark and Tim Evans.

I'm not sure exactly which change made it work. I first eliminated the 
"-g sysadmin", because of a suggestion that there was a conflict between 
that and the "-c". Next day I still had the same errors.

So, I also eliminated the "-c" AND went through the /var/adm directory 
and cleaned up the log files. There were zero length .gz files that had 
been created but not filled along with the corresponding log files that 
had not been gzipped into them. I removed all the zero length .gz files 
and gzipped all the log files that should have been and weren't. With 
the files cleaned up, and the "-c" removed from the logadm.conf as well 
as the "-g sysadmin", I got no errors today and the logs were rotated 
and gzipped.

Then, the really puzzling thing was that isc.dhcpd and named were 
logging to .log.0 rather than to .log -- they apparently followed the 
moved file rather than sticking with the file path and name. This 
continued even after I stopped and started isc.dhcpd and HUPed named. 
Then I looked at /etc/syslog.conf and saw that they were logging through 
syslog with local3 and local4. Mail was also logging through syslog as 
mail.info, but did not have this problem. I then did a HUP on syslogd 
and the logging started going to .log for both dhcpd and named. So, I 
added that to the configurations in logadm.conf.

I'm presuming everything will go fine tomorrow morning.

Current entries are:

    /var/adm/dhcpd.log -C 30 -P 'Tue Jun 21 07:10:00 2005' \
       -a 'kill -HUP `cat /var/run/syslog.pid`' -p 1d -z 1
    /var/adm/mail.log -C 30 -P 'Fri Jun 17 07:10:00 2005' \
       -a 'kill -HUP `cat /var/run/syslog.pid`' -p 1w -z 1
    /var/adm/named.log -C 7 -P 'Tue Jun 21 07:10:00 2005' \
       -a 'kill -HUP `cat /var/run/syslog.pid`' -p 1d -z 1



Thanks again,


---------------

Chris Hoogendyk

-
    O__  ---- Systems Administrator
   c/ /'_ --- Biology Department
  (*) \(*) -- 140 Morrill Science Center
~~~~~~~~~~ - University of Massachusetts, Amherst

<hoogendyk@bio.umass.edu>

---------------




-------- Original Message --------
Subject: [Fwd: Output from "cron" command]
Date: Fri, 17 Jun 2005 16:14:03 -0400
From: Chris Hoogendyk <hoogendyk@bio.umass.edu>
To: Sun Managers List <sunmanagers@sunmanagers.org>

Does anyone have a clue why my log rotation is not working? I've used
logadm to set it up. Below is one of the messages sent by the cron job.
It doesn't complain about rotating /var/adm/messages which is similar in
the configuration of its rotation.

I've included /etc/syslog.conf and /etc/logadm.conf after the cron message.

Thanks,


---------------

Chris Hoogendyk

-
    O__  ---- Systems Administrator
   c/ /'_ --- Biology Department
  (*) \(*) -- 140 Morrill Science Center
~~~~~~~~~~ - University of Massachusetts, Amherst

<hoogendyk@bio.umass.edu>

---------------



-------- Original Message --------
Subject: Output from "cron" command
Date: Fri, 17 Jun 2005 03:10:10 -0400 (EDT)
From: Super-User <root@pilot.bio.umass.edu>
To: root@pilot.bio.umass.edu

Your "cron" job on pilot
/usr/sbin/logadm

produced the following output:

logadm: Warning: command failed: /bin/gzip /var/adm/dhcpd.log.4
gzip: /var/adm/dhcpd.log.4.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/dhcpd.log.3
gzip: /var/adm/dhcpd.log.3.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/dhcpd.log.2
gzip: /var/adm/dhcpd.log.2.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/dhcpd.log.1
gzip: /var/adm/dhcpd.log.1.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/mail.log.2
gzip: /var/adm/mail.log.2.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/mail.log.1
gzip: /var/adm/mail.log.1.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/named.log.3
gzip: /var/adm/named.log.3.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/named.log.2
gzip: /var/adm/named.log.2.gz already exists;	not overwritten
logadm: Warning: command failed: /bin/gzip /var/adm/named.log.1
gzip: /var/adm/named.log.1.gz already exists;	not overwritten




-------------- /etc/syslog.conf -----------------

#ident  "@(#)syslog.conf        1.5     98/12/14 SMI"   /* SunOS 5.0 */
#
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
# syslog configuration file.
#
# This file is processed by m4 so be careful to quote (`') names
# that match m4 reserved words.  Also, within ifdef's, arguments
# containing commas must be quoted.
#
*.err;kern.notice;auth.notice                   /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit        /var/adm/messages

*.alert;kern.err;daemon.err                     operator
*.alert                                         root

*.emerg                                         *

# if a non-loghost machine chooses to have authentication messages
# sent to the loghost machine, un-comment out the following line:
auth.notice                     ifdef(`LOGHOST', /var/log/authlog, @loghost)

mail.debug                      ifdef(`LOGHOST', /var/log/syslog, @loghost)

#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(`LOGHOST', ,
user.err                                        /dev/sysmsg
user.err                                        /var/adm/messages
user.alert                                      `root, operator'
user.emerg                                      *
)

#
# In order to separate out mail we should create a mail.log file
#
mail.info                                       /var/adm/mail.log

#
# local3 is reserved for named
#
local3.info                                     /var/adm/named.log

#
# local4 is reserved for dhcp
#
local4.info                                     /var/adm/dhcpd.log




-------------- /etc/logadm.conf -----------------

pilot:/usr/local/adm/backup# more /etc/logadm.conf
# Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident  "@(#)logadm.conf        1.2     02/02/13 SMI"
#
# logadm.conf
#
# Default settings for system log file management.
# The -w option to logadm(1M) is the preferred way to write to this file,
# but if you do edit it by hand, use "logadm -V" to check it for errors.
#
# The format of lines in this file is:
#       <logname> <options>
# For each logname listed here, the default options to logadm
# are given.  Options given on the logadm command line override
# the defaults contained in this file.
#
# logadm typically runs early every morning via an entry in
# root's crontab (see crontab(1)).
#
/var/log/syslog -C 8 -P 'Fri Jun 17 07:10:00 2005' -a 'kill -HUP `cat
/var/run/syslog.pid`'
/var/adm/messages -C 4 -P 'Fri Jun 17 07:10:00 2005' -a 'kill -HUP `cat
/var/run/syslog.pid`' -z 1
/var/cron/log -c -s 512k -t /var/cron/olog
/var/lp/logs/lpsched -C 2 -N -t '$file.$N'
#
# The entry below is used by turnacct(1M)
#
/var/adm/pacct -C 0 -N -a '/usr/lib/acct/accton pacct' -g adm -m 664 -o
adm -p never
#
# The following are local rotate rules
#   Please use logadm <options> -w <logfile> to enter these rules.
#   See see the logadm man pages for more information.
#
/var/adm/dhcpd.log -C 30 -P 'Fri Jun 17 07:10:00 2005' -c -g sysadmin -p
1d -z 1
/var/adm/mail.log -C 30 -P 'Fri Jun 17 07:10:00 2005' -c -g sysadmin -p
1w -z 1
/var/adm/named.log -C 7 -P 'Fri Jun 17 07:10:00 2005' -c -g sysadmin -p
1d -z 1
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Jun 21 12:37:31 2005

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:49 EST