Bug 1265547
| Summary: | [vdsm] logrotate for /var/log/core again not working | ||
|---|---|---|---|
| Product: | [oVirt] vdsm | Reporter: | Jiri Belka <jbelka> |
| Component: | General | Assignee: | Yaniv Bronhaim <ybronhei> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Jiri Belka <jbelka> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | --- | CC: | bazulay, bugs, danken, ecohen, gklein, jbelka, knarra, lsurette, mgoldboi, obockows, oourfali, rbalakri, sbonazzo, ybronhei, ycui, yeylon |
| Target Milestone: | ovirt-3.6.1 | Keywords: | Regression |
| Target Release: | 4.17.11 | Flags: | rule-engine:
ovirt-3.6.z+
rule-engine: blocker+ mgoldboi: planning_ack+ oourfali: devel_ack+ pstehlik: testing_ack+ |
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | infra | ||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-01-13 14:38:14 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1305135 | ||
|
Description
Jiri Belka
2015-09-23 08:24:39 UTC
This bug report has Keywords: Regression or TestBlocker. Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP. I tried that and it worked fine: please see below and tell me what I miss.. [root@vm-17-62 core]# kill -6 5185 [root@vm-17-62 core]# ls core.5185.1444820851.dump [root@vm-17-62 core]# [root@vm-17-62 core]# [root@vm-17-62 core]# logrotate -v -f /etc/vdsm/logrotate/vdsm 2>&1 | sed -n '/^rotating pattern: \/var\/log\/core/,$p' rotating pattern: /var/log/core/*.dump forced from command line (1 rotations) empty log files are rotated, old logs are removed switching euid to 36 and egid to 36 considering log /var/log/core/core.5185.1444820851.dump log needs rotating rotating log /var/log/core/core.5185.1444820851.dump, log->rotateCount is 1 dateext suffix '-20151014' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' renaming /var/log/core/core.5185.1444820851.dump.1.xz to /var/log/core/core.5185.1444820851.dump.2.xz (rotatecount 1, logstart 1, i 1), old log /var/log/core/core.5185.1444820851.dump.1.xz does not exist renaming /var/log/core/core.5185.1444820851.dump.0.xz to /var/log/core/core.5185.1444820851.dump.1.xz (rotatecount 1, logstart 1, i 0), old log /var/log/core/core.5185.1444820851.dump.0.xz does not exist log /var/log/core/core.5185.1444820851.dump.2.xz doesn't exist -- won't try to dispose of it fscreate context set to system_u:object_r:virt_cache_t:s0 renaming /var/log/core/core.5185.1444820851.dump to /var/log/core/core.5185.1444820851.dump.1 compressing log with: /usr/bin/xz switching uid to 36 and gid to 36 switching euid to 0 and egid to 0 set default create context [root@vm-17-62 core]# geten getenforce getent [root@vm-17-62 core]# geten getenforce getent [root@vm-17-62 core]# getenforce Enforcing [root@vm-17-62 core]# This bug report has Keywords: Regression or TestBlocker. Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP. (In reply to Yaniv Bronhaim from comment #2) > I tried that and it worked fine: please see below and tell me what I miss.. > > [root@vm-17-62 core]# kill -6 5185 > [root@vm-17-62 core]# ls > core.5185.1444820851.dump this info is not complete, what about `ls -l' on this file? who's owner, what group is set? > [root@vm-17-62 core]# > [root@vm-17-62 core]# > [root@vm-17-62 core]# logrotate -v -f /etc/vdsm/logrotate/vdsm 2>&1 | sed -n > '/^rotating pattern: \/var\/log\/core/,$p' > rotating pattern: /var/log/core/*.dump forced from command line (1 > rotations) > empty log files are rotated, old logs are removed > switching euid to 36 and egid to 36 > considering log /var/log/core/core.5185.1444820851.dump > log needs rotating > rotating log /var/log/core/core.5185.1444820851.dump, log->rotateCount is 1 > dateext suffix '-20151014' > glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' > renaming /var/log/core/core.5185.1444820851.dump.1.xz to > /var/log/core/core.5185.1444820851.dump.2.xz (rotatecount 1, logstart 1, i > 1), > old log /var/log/core/core.5185.1444820851.dump.1.xz does not exist > renaming /var/log/core/core.5185.1444820851.dump.0.xz to > /var/log/core/core.5185.1444820851.dump.1.xz (rotatecount 1, logstart 1, i > 0), > old log /var/log/core/core.5185.1444820851.dump.0.xz does not exist > log /var/log/core/core.5185.1444820851.dump.2.xz doesn't exist -- won't try > to dispose of it > fscreate context set to system_u:object_r:virt_cache_t:s0 > renaming /var/log/core/core.5185.1444820851.dump to > /var/log/core/core.5185.1444820851.dump.1 > compressing log with: /usr/bin/xz > switching uid to 36 and gid to 36 > switching euid to 0 and egid to 0 > set default create context no info about OS at all. fully reproducible on: [root@dell-r210ii-04 core]# rpm -qa kernel systemd redhat-release-server selinux-policy-targeted selinux-policy-targeted-3.13.1-60.el7.noarch redhat-release-server-7.2-7.el7.x86_64 systemd-219-19.el7.x86_64 kernel-3.10.0-324.el7.x86_64 [root@dell-r210ii-04 core]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.2 Beta (Maipo) [root@dell-r210ii-04 core]# rpm -qa kernel systemd redhat-release-server selinux-policy-targeted selinux-policy-targeted-3.13.1-60.el7.noarch redhat-release-server-7.2-7.el7.x86_64 systemd-219-19.el7.x86_64 kernel-3.10.0-324.el7.x86_64 installed from: http://download.englab.brq.redhat.com/pub/rhel/rel-eng/RHEL-7.2-20151015.0/compose/Server/x86_64/os/ [root@dell-r210ii-04 core]# ls -l total 52960 -rw-------. 1 qemu qemu 1269874688 Oct 23 17:39 core.15104.1445614743.dump [root@dell-r210ii-04 core]# logrotate -v -f /etc/vdsm/logrotate/vdsm 2>&1 | sed -n '/^rotating pattern: \/var\/log\/core/,$p' rotating pattern: /var/log/core/*.dump forced from command line (1 rotations) empty log files are rotated, old logs are removed switching euid to 36 and egid to 36 considering log /var/log/core/core.15104.1445614743.dump log needs rotating rotating log /var/log/core/core.15104.1445614743.dump, log->rotateCount is 1 dateext suffix '-20151023' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' renaming /var/log/core/core.15104.1445614743.dump.1.xz to /var/log/core/core.15104.1445614743.dump.2.xz (rotatecount 1, logstart 1, i 1), old log /var/log/core/core.15104.1445614743.dump.1.xz does not exist renaming /var/log/core/core.15104.1445614743.dump.0.xz to /var/log/core/core.15104.1445614743.dump.1.xz (rotatecount 1, logstart 1, i 0), old log /var/log/core/core.15104.1445614743.dump.0.xz does not exist log /var/log/core/core.15104.1445614743.dump.2.xz doesn't exist -- won't try to dispose of it error: error opening /var/log/core/core.15104.1445614743.dump: Permission denied switching euid to 0 and egid to 0 set default create context Of course it doesn't work.. this is qemu core dump. vdsm configuration rotates the file as vdsm user - therefore it can rotate only vdsm core dump files which are created by vdsm user - do you except vdsm configuration to rotate any core file in this directory? If yes we need to remove the "su vdsm kvm" in /etc/vdsm/logrotate/vdsm. Dan, this was added quite long ago - http://gerrit.ovirt.org/971 we configure to throw all coredumps to /var/log/core , also libvirt's which are created by root .. What do you say? su root root? I'm curious, what is then that core file in /var/log/core ? :) I just send ABRT signal to qemu-kvm. Yaniv, I'm afraid that I don't recall the motivation for adding "su" to logrotate. Until we integrate properly with ABRT, and as long we mess with /var/log/core, we should be able to log-rotate everything that is put there. so be it - I can't just remove the su to rotate files. it will give us: error: skipping "/var/log/core/core.5626.1445764996.dump" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation. Therefore, we will need "su root root" there .. *** Bug 1221464 has been marked as a duplicate of this bug. *** ok, vdsm-4.17.15-0.el7ev.noarch
# grep su /etc/vdsm/logrotate/vdsm ; rpm -qf /etc/vdsm/logrotate/vdsm
su root root
vdsm-4.17.15-0.el7ev.noarch
# ls -l /var/log/core/core.16118.1452686885.dump
-rw-------. 1 qemu qemu 1839423488 Jan 13 13:08 /var/log/core/core.16118.1452686885.dump
# logrotate -v -f /etc/vdsm/logrotate/vdsm 2>&1 | sed -n '/^rotating pattern: \/var\/log\/core/,$p'
rotating pattern: /var/log/core/*.dump forced from command line (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/core/core.16118.1452686885.dump
log needs rotating
rotating log /var/log/core/core.16118.1452686885.dump, log->rotateCount is 1
dateext suffix '-20160113'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/core/core.16118.1452686885.dump.1.xz to /var/log/core/core.16118.1452686885.dump.2.xz (rotatecount 1, logstart 1, i 1),
old log /var/log/core/core.16118.1452686885.dump.1.xz does not exist
renaming /var/log/core/core.16118.1452686885.dump.0.xz to /var/log/core/core.16118.1452686885.dump.1.xz (rotatecount 1, logstart 1, i 0),
old log /var/log/core/core.16118.1452686885.dump.0.xz does not exist
log /var/log/core/core.16118.1452686885.dump.2.xz doesn't exist -- won't try to dispose of it
fscreate context set to system_u:object_r:virt_cache_t:s0
renaming /var/log/core/core.16118.1452686885.dump to /var/log/core/core.16118.1452686885.dump.1
compressing log with: /usr/bin/xz
set default create context
[root@dell-r210ii-13 ~]# ls -l /var/log/core/
total 150896
-rw-------. 1 qemu qemu 154513628 Jan 13 13:08 core.16118.1452686885.dump.1.xz
oVirt 3.6.1 has been released, closing current release *** Bug 1311053 has been marked as a duplicate of this bug. *** |