RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1136881 - spice-vdagent logs twice to /var/log/spice-vdagent.log
Summary: spice-vdagent logs twice to /var/log/spice-vdagent.log
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: spice-vdagent
Version: 7.0
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Default Assignee for SPICE Bugs
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-03 14:11 UTC by Swapna Krishnan
Modified: 2015-03-05 08:17 UTC (History)
5 users (show)

Fixed In Version: spice-vdagent-0.14.0-9.el7
Doc Type: Bug Fix
Doc Text:
After upgrading from RHEL6, spice-vdagent would log twice to syslog. The rsyslog configuration file causing that logging has now been removed, journalctl can be used to filter syslog output with SYSLOG_IDENTIFIER
Clone Of:
Environment:
Last Closed: 2015-03-05 08:17:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0359 0 normal SHIPPED_LIVE spice-vdagent bug fix update 2015-03-05 12:39:08 UTC

Description Swapna Krishnan 2014-09-03 14:11:00 UTC
Description of problem:
I built spice-vdagent from upstream on RHEL 6.6. spice-vdagent logs the same line twice to /var/log/spice-vdagent.log

[root@dhcp-25-77 ~]# service spice-vdagentd restart
Stopping spice-vdagentd:                                   [  OK  ]
Starting spice-vdagentd:                                   [  OK  ]
[root@dhcp-25-77 ~]# tail /var/log/spice-vdagent.log 
Sep  3 09:24:34.023944 spice-vdagentd: debug: Set max clipboard: 104857600
Sep  3 09:24:34.023944 spice-vdagentd: debug: Set max clipboard: 104857600
Sep  3 10:01:41.364314 spice-vdagentd: info: vdagentd quiting, returning status 0
Sep  3 10:01:41.364314 spice-vdagentd: info: vdagentd quiting, returning status 0
Sep  3 10:01:43.591880 spice-vdagentd: info: opening vdagent virtio channel
Sep  3 10:01:43.591880 spice-vdagentd: info: opening vdagent virtio channel
Sep  3 10:01:43.662679 spice-vdagentd: debug: Set max clipboard: 104857600
Sep  3 10:01:43.662679 spice-vdagentd: debug: Set max clipboard: 104857600
Sep  3 10:01:43.662814 spice-vdagentd: debug: Set max clipboard: 104857600
Sep  3 10:01:43.662814 spice-vdagentd: debug: Set max clipboard: 104857600

Version-Release number of selected component (if applicable):
Built spice-vdagent from upstream. Spice guest agent X11 session agent, version 0.15.0.
rsyslog-5.8.10-8.el6.x86_64

On host:
spice-gtk-python-0.22-7.el6.x86_64
spice-gtk-0.22-7.el6.x86_64
spice-server-0.12.4-11.el6.x86_64
spice-glib-0.22-7.el6.x86_64

On client:
virt-viewer-0.6.0-1.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Built spice-vdagent from upstream on RHEL 6.6
2. Restarted spice-vdagent

Actual results:
spice-vdagent log has double of every line. 

Expected results:
only single log of each line

Please let me know if there's any other info/log I can provide. 

Thanks,
- Swapna

Comment 1 Marc-Andre Lureau 2014-09-03 14:20:40 UTC
The following will log twice on rhel6, and once in f20/rhel7. This seems to be somehow a libc/syslog bug.

#include <syslog.h>

void main() {
    openlog("spice-vdagent", LOG_PID, LOG_USER);
    syslog(LOG_ERR, "foo");
}

reassigning to rsyslog for more investigation.

Comment 3 Tomas Heinrich 2014-09-04 09:42:30 UTC
(In reply to Marc-Andre Lureau from comment #1)
> The following will log twice on rhel6, and once in f20/rhel7. This seems to
> be somehow a libc/syslog bug.

Log twice to where? I don't see it on my el6 with rsyslog-5.8.10-8.el6.x86_64.

Could you post your rsyslog version? Have you done any changes to /etc/rsyslog.conf? Are there any files in /etc/rsyslog.d?

Comment 4 Tomas Heinrich 2014-09-04 09:49:45 UTC
(In reply to Swapna Krishnan from comment #0)
> Description of problem:
> I built spice-vdagent from upstream on RHEL 6.6. spice-vdagent logs the same
> line twice to /var/log/spice-vdagent.log

The /var/log/spice-vdagent.log file is not handled by rsyslog - unless one of the packages dropped a configuration file into /etc/rsyslog.d. Thus this probably has nothing to do with rsyslog.

You can loop up what is writing to /var/log/spice-vdagent.log with "fuser -v /var/log/spice-vdagent.log".

Comment 5 Marc-Andre Lureau 2014-09-04 10:35:08 UTC
(In reply to Tomas Heinrich from comment #3)
> Log twice to where? I don't see it on my el6 with
> rsyslog-5.8.10-8.el6.x86_64.
> 
> Could you post your rsyslog version? Have you done any changes to

same version

> /etc/rsyslog.conf? Are there any files in /etc/rsyslog.d?


Yes, I didn't realize before.

The spice-vdagent.spec says:
# RHEL-6 has no /etc/rsyslog.d

so /etc/rsyslog.conf is modified with this appended:

# A template to for higher precision timestamps + severity logging
$template SpiceTmpl,"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"

:programname, startswith, "spice-vdagent"	/var/log/spice-vdagent.log;SpiceTmpl

And I have /etc/rsyslog.d/spice-vdagentd.conf as well, probably because I did "make install" manually.

So closing this bug

Comment 6 Marc-Andre Lureau 2014-09-04 10:37:15 UTC
> And I have /etc/rsyslog.d/spice-vdagentd.conf as well, probably because I
> did "make install" manually.
> 
> So closing this bug

Sorry, I submitted a bit too quickly. So, the rhel package doesn't create /etc/rsyslog.d/spice-vdagentd.conf. It was added manually, so it is user fault.

Removing /etc/rsyslog.d/spice-vdagentd.conf solves the issue.

Comment 7 Christophe Fergeau 2014-09-05 07:57:07 UTC
The RHEL7 package installs /etc/rsyslog.d/spice-vdagentd.conf , I suspect it will be possible to get in the situation you describe on VM upgrades:
- user installs the RHEL6 package, rsyslogd.conf is modified to add the spice-vdagent snippet
- user upgrades to RHEL7, rsyslogd.conf most likely stays unchanged, and the package installs /etc/rsyslog.d/spice-vdagentd.conf

Comment 8 Marc-Andre Lureau 2014-09-05 10:14:22 UTC
(In reply to Christophe Fergeau from comment #7)
> The RHEL7 package installs /etc/rsyslog.d/spice-vdagentd.conf , I suspect it
> will be possible to get in the situation you describe on VM upgrades:
> - user installs the RHEL6 package, rsyslogd.conf is modified to add the
> spice-vdagent snippet
> - user upgrades to RHEL7, rsyslogd.conf most likely stays unchanged, and the
> package installs /etc/rsyslog.d/spice-vdagentd.conf

that's very likely. Is it supported rhel6->rhel7 upgrade? Any idea how to handle that?

Comment 9 Christophe Fergeau 2014-09-05 12:03:42 UTC
Yes, rhel6->rhel7 upgrades are supposed to be supported.

rhel6 seems to have /etc/rsyslog.d these days, so one first step could be to stop patching rsyslogd.conf and always install a file in rsyslog.d.

We could try to remove automatically what we added to rsyslod.conf on upgrades, but we have to be careful there as the file might have been user-modified, and we need to make sure we don't break it.
Another option may be to not install the file in rsyslog.d when we are doing an upgrade, but I don't know how easy it is to do.

Comment 10 Marc-Andre Lureau 2014-09-05 13:19:57 UTC
(In reply to Christophe Fergeau from comment #9)
> Yes, rhel6->rhel7 upgrades are supposed to be supported.
> 
> rhel6 seems to have /etc/rsyslog.d these days, so one first step could be to
> stop patching rsyslogd.conf and always install a file in rsyslog.d.

Well, that would be pushing the problem in even more common cases.

> We could try to remove automatically what we added to rsyslod.conf on
> upgrades, but we have to be careful there as the file might have been
> user-modified, and we need to make sure we don't break it.

Yes, difficult option imho.

> Another option may be to not install the file in rsyslog.d when we are doing
> an upgrade, but I don't know how easy it is to do.

I don't know how rsyslog work, it would be nice if there would be a way to avoid duplication of rules.

I guess the easier in rhel7 is to not install (remove in update) the rsyslog.d file, and keep the .conf rule we have instead...

Also, it's not that useful to have clear text seperate syslog files for vdagent, we could probably remove that rsyslog config, and use journalctl SYSLOG_IDENTIFIER=spice-vdagent  SYSLOG_IDENTIFIER=spice-vdagentd

I would go for the last option and I sent a patch to remove rsyslog config files from upstream to prevent this problem from happening when installing from tarball (what happened to me and swapna probably):
http://lists.freedesktop.org/archives/spice-devel/2014-September/017355.html

Comment 12 Christophe Fergeau 2014-09-08 08:41:44 UTC
(In reply to Marc-Andre Lureau from comment #10)
> I guess the easier in rhel7 is to not install (remove in update) the
> rsyslog.d file, and keep the .conf rule we have instead...

This sounds like a step backward...
Something ugly that should work would be to grep the .conf file for the vdagent stuff that used to be added there, and to remove the rsyslog.d file when it is present.

> 
> Also, it's not that useful to have clear text seperate syslog files for
> vdagent, we could probably remove that rsyslog config, and use journalctl
> SYSLOG_IDENTIFIER=spice-vdagent  SYSLOG_IDENTIFIER=spice-vdagentd

I don't know if there are some rules as to when to rely on journalctl and when to use rsyslog, but this makes sense.

Comment 13 Christophe Fergeau 2014-09-19 10:03:21 UTC
Patch from comment #10 is upstream now.

Comment 17 errata-xmlrpc 2015-03-05 08:17:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0359.html


Note You need to log in before you can comment on or make changes to this bug.