<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>718</bug_id>
          
          <creation_ts>2011-02-14 09:18:51 +0000</creation_ts>
          <short_desc>Allow logrotate to use a different file system from the original logs</short_desc>
          <delta_ts>2012-03-12 01:42:15 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(P3) (QA testing completed) Done</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gary Thomas">gary</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>liang.li2</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11736</commentid>
    <comment_count>0</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-14 09:18:51 +0000</bug_when>
    <thetext>Current implementations of logrotate restrict the location of the destination directory to be on the same file system as the files being rotated out.  This is purely for implementation simplicity - a hard link is used.  However, it makes it difficult to use when the main log files live in ramdisk and one wants to preserve them in FLASH.

Given that in many cases the logs are compressed as they are being rotated, using hard links doesn&apos;t buy much anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18842</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2012-03-02 08:45:41 +0000</bug_when>
    <thetext>
Hi Gary,

I think this is because the logrotate uses:

rename(const char *oldpath, const char *newpath);

to rotate the log, the rename can&apos;t acrosses the different filesystems,
I will use read and write to replace the rename if you are OK with it,
and will send the patch review next week after enough testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18924</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-03-08 20:45:30 +0000</bug_when>
    <thetext>Fixed in http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=d7663ff7ab2e5ef5c913befad5e0adfbd6cc22a2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18960</commentid>
    <comment_count>3</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-03-12 01:42:15 +0000</bug_when>
    <thetext>verified it on :
git info:6bd23e0faf329f086bb4885991ce5f5d095dac56
git branch: poky/master

use following steps:
1. set build env,run &quot;source ./oe-init-build-env builddir&quot;.
2. add lines to the conf/local.conf of builddir.
   DISTRO_EXTRA_RDEPENDS += &quot;logrotate&quot;
3. run &quot;bitbake core-image-sato&quot;.
4. boot up image and add following configuration option to &quot;/etc/logroate.conf&quot;:
   ...
   /var/log/wtmp {
    monthly
    create 0664 root utmp
        minsize 1M
    olddir /home/root/logrotate_dir
    rotate 1
}
   ...
   and &quot;/home/root&quot; is on different filesystem to which &quot;/var/log/wtmp&quot; is on.
5. run &quot;logrotate -f /etc/logrotate.conf&quot;.

wtmp-20120312 is found in /home/root/logrotate_dir.

test env:
host : ubuntu 11.10 x86_64
kernel : 3.0.0-16-generic #29-Ubuntu SMP</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>