| Summary: | Allow logrotate to use a different file system from the original logs | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Meta-yocto | Reporter: | Gary Thomas <gary> |
| Component: | meta-yocto | Assignee: | Robert Yang <liezhi.yang> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Low | CC: | liang.li2, liezhi.yang, poky.bs.watcher, poky.watcher, richard.purdie, sgw, yi.zhao |
| Version: | unspecified | ||
| Target Milestone: | 1.2 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | (P3) (QA testing completed) Done | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Gary Thomas
2011-02-14 09:18:51 UTC
Hi Gary, I think this is because the logrotate uses: rename(const char *oldpath, const char *newpath); to rotate the log, the rename can'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. Fixed in http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=d7663ff7ab2e5ef5c913befad5e0adfbd6cc22a2 verified it on :
git info:6bd23e0faf329f086bb4885991ce5f5d095dac56
git branch: poky/master
use following steps:
1. set build env,run "source ./oe-init-build-env builddir".
2. add lines to the conf/local.conf of builddir.
DISTRO_EXTRA_RDEPENDS += "logrotate"
3. run "bitbake core-image-sato".
4. boot up image and add following configuration option to "/etc/logroate.conf":
...
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
olddir /home/root/logrotate_dir
rotate 1
}
...
and "/home/root" is on different filesystem to which "/var/log/wtmp" is on.
5. run "logrotate -f /etc/logrotate.conf".
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
|