From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NeJgQ-0008AB-Dc for ltp-list@lists.sourceforge.net; Mon, 08 Feb 2010 02:49:06 +0000 Received: from out07.sjc.mx.trendmicro.com ([216.99.131.23]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NeJgO-0007Iv-J5 for ltp-list@lists.sourceforge.net; Mon, 08 Feb 2010 02:49:06 +0000 Received: from relay04.sjc.mx.trendmicro.com (unknown [10.30.239.10]) by out07.sjc.mx.trendmicro.com (Postfix) with ESMTP id C9552B7A459 for ; Mon, 8 Feb 2010 02:48:58 +0000 (UTC) Received: from smtp-gate.ryobi.co.jp (unknown [210.163.224.132]) by relay04.sjc.mx.trendmicro.com (Postfix) with ESMTP id C753A1D7834 for ; Mon, 8 Feb 2010 02:48:57 +0000 (UTC) Received: from 5108637 ([10.113.10.201]) by po.rsoa.ryobi.co.jp (Post.Office MTA v4.1.1 release 20090730 ID# 201-058U1200L1200S0V41J) with ESMTP id jp for ; Mon, 8 Feb 2010 11:48:55 +0900 From: "Yuki Yao" Date: Mon, 8 Feb 2010 11:48:55 +0900 Message-ID: <000501caa869$41be6670$c53b3350$@co.jp> MIME-Version: 1.0 Content-Language: ja Subject: [LTP] [PATCH]logrotate: /var/log/messages* disappeared List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7623760960522566627==" Errors-To: ltp-list-bounces@lists.sourceforge.net To: ltp-list@lists.sourceforge.net This is a multi-part message in MIME format. --===============7623760960522566627== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01CAA8B4.B1A60E70" Content-Language: ja This is a multi-part message in MIME format. ------=_NextPart_000_0006_01CAA8B4.B1A60E70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, I found a problem on LTP when I execute ./runltp. After execute ./runltp, all log files such as /var/log/messages* disappeared, and there is only new log files that were created after the test... This seems a problem that occurs after the "logrotate01" test. I found that the past log files disappeared by forcing a rotate (logrotate -fv $LTPTMP/tst_logrotate.conf). Besides, "logrotate"'s shell script ./testcases/commands/logrotate/logrotate_tests.sh creats logrotate configuration file ($LTPTMP/tst_logrotate.conf) for the test, and this config file includes /etc/logrotate.d as follows: [ ./testcases/commands/logrotate/logrotate_tests.sh line:156~ ] ---------- # create config file. cat >$LTPTMP/tst_logrotate.conf <<-EOF #****** Begin Config file ******* # create new (empty) log files after rotating old ones create # compress the log files compress # RPM packages drop log rotation information into this directory include /etc/logrotate.d /var/log/tst_logfile { rotate 5 weekly } #****** End Config file ******* EOF ---------- By this, not only a log file for the test (/var/log/tst_logfile), but also 30 fies in my system such as /var/log/messages* become "logrotate" command target. Therefore, only a log file for this test must be made a target of the forced execution of "logrotate". To resolve this problem, we have to change this not to include /etc/logrotate.d, I think. Index: testcases/commands/logrotate/logrotate_tests.sh ============================== --- logrotate_tests.sh 2008-10-21 15:54:15.000000000 +0900 +++ logrotate_tests.sh.new 2010-02-05 18:56:14.000000000 +0900 @@ -163,7 +163,7 @@ compress # RPM packages drop log rotation information into this directory - include /etc/logrotate.d + # include /etc/logrotate.d /var/log/tst_logfile { rotate 5 @@ -200,7 +200,7 @@ # check if /etc/logrotate.d is included/ # check if 5 rotations are forced. # check if compression is done. - grep "including /etc/logrotate.d" $LTPTMP/tst_logrotate.out \ + # grep "including /etc/logrotate.d" $LTPTMP/tst_logrotate.out \ > $LTPTMP/tst_logrotate.err 2>&1 || RC=$? grep "reading config file $LTPTMP/tst_logrotate.conf" \ $LTPTMP/tst_logrotate.out > $LTPTMP/tst_logrotate.err 2>&1 || RC=$? Thank you, --Yuki Yao ------=_NextPart_000_0006_01CAA8B4.B1A60E70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I = found a problem on LTP when I execute ./runltp.

After = execute ./runltp, all log files such as /var/log/messages* disappeared, =

and = there is only new log files that were created after the test...

 

This = seems a problem that occurs after the "logrotate01" test. =

I = found that the past log files disappeared by forcing a rotate (logrotate -fv $LTPTMP/tst_logrotate.conf).

 

Besides, "logrotate"'s shell script ./testcases/commands/logrotate/logrotate_tests.sh creats =

logrotate configuration file ($LTPTMP/tst_logrotate.conf) for the test, and this = config file includes

/etc/logrotate.d as follows:

[ ./testcases/commands/logrotate/logrotate_tests.sh line:156~ = ]

----------

# = create config file.

       &nbs= p;      cat >$LTPTMP/tst_logrotate.conf <<-EOF

       &nbs= p;      #****** Begin Config file *******

       &nbs= p;      # create new (empty) log files after rotating old = ones

       &nbs= p;      create

 

       &nbs= p;      # compress the log files

       &nbs= p;      compress

 

       &nbs= p;      # RPM packages drop log rotation information into this = directory

       &nbs= p;      include /etc/logrotate.d

 

       &nbs= p;      /var/log/tst_logfile {

       &nbs= p;            = ;        rotate 5

       &nbs= p;            = ;        weekly

       &nbs= p;      }

       &nbs= p;      #****** End Config file *******

       &nbs= p;      EOF

----------

 

By = this, not only a log file for the test (/var/log/tst_logfile), but also 30 fies in my = system

such = as /var/log/messages* become "logrotate" command = target.

Therefore, only a log file for this test must be made a target of the forced execution of "logrotate".

 

To = resolve this problem, we have to change this not to include /etc/logrotate.d, I = think.

 

Index: testcases/commands/logrotate/logrotate_tests.sh

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

--- logrotate_tests.sh         &= nbsp; 2008-10-21 15:54:15.000000000 +0900

+++ logrotate_tests.sh.new  2010-02-05 18:56:14.000000000 = +0900

@@ = -163,7 +163,7 @@

       &nbs= p;     compress

 

       &nbs= p;     # RPM packages drop log rotation information into this = directory

-       &nb= sp;     include /etc/logrotate.d

+       &nb= sp;    # include /etc/logrotate.d

 

       &nbs= p;     /var/log/tst_logfile {

       &nbs= p;            = ;       rotate 5

@@ = -200,7 +200,7 @@

       &nbs= p;            = ;       # check if  /etc/logrotate.d is included/

       &nbs= p;            = ;       # check if 5 rotations are forced.

         # check if compression is done.

-       &nb= sp;           &nbs= p;       grep "including /etc/logrotate.d" $LTPTMP/tst_logrotate.out = \

+       &nb= sp;           &nbs= p;      # grep "including /etc/logrotate.d" $LTPTMP/tst_logrotate.out = \

       &nbs= p;            = ;            =          > $LTPTMP/tst_logrotate.err 2>&1 || = RC=3D$?

       &nbs= p;            = ;       grep "reading config file $LTPTMP/tst_logrotate.conf" = \

       &nbs= p;            = ;            =          $LTPTMP/tst_logrotate.out   > $LTPTMP/tst_logrotate.err 2>&1 || RC=3D$?

 

Thank = you,

  --Yuki Yao

 

------=_NextPart_000_0006_01CAA8B4.B1A60E70-- --===============7623760960522566627== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com --===============7623760960522566627== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list --===============7623760960522566627==--