Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yum Install dependency collision with rsyslog #1384

Closed
LTRand opened this issue Mar 14, 2017 · 28 comments · Fixed by #3324
Closed

Yum Install dependency collision with rsyslog #1384

LTRand opened this issue Mar 14, 2017 · 28 comments · Fixed by #3324

Comments

@LTRand
Copy link

LTRand commented Mar 14, 2017

syslog-ng

Version of syslog-ng

latest (3/14/17)


## Platform

RHEL7

# Issue
syslog-ng fails to install via standard yum install.

## Failure
syslog-ng package wants to write to /etc/logrotate.d/syslog.  Systems with rsyslog installed report this as a dependency violation.

## Optimal fix
configure package to use /etc/logrotate.d/syslog-ng to avoid future collision.

@faxm0dem
Copy link
Contributor

@czanik you really want to rename the logrotate file. I think if we should call it syslog-ng and comment stuff in it

@czanik
Copy link
Contributor

czanik commented Mar 16, 2017

@LTRand

  • which RHEL version do you use?
  • which syslog-ng do you use? 3.5 from EPEL? 3.9 from Copr?

I had long discussions with Red Hat about it, but renaming it to syslog-ng does not work. The problem is, that if rsyslog stays on the system, logs are rotated twice. If we comment out the content and rsyslog is removed, then we don't have logrotation.
And to make it even nicer: the content of the file changed somewhere during the RHEL 7.2 lifecycle. AFAIR, both the EPEL and Copr packages have the this later /etc/logrotate.d/syslog included.

@faxm0dem
Copy link
Contributor

Well, then let's manage the file using a %post scriptlet:

  • if rsyslog is installed, do nothing
  • if rsyslog is not installed, generate the file

what do you think?

@alexxkn
Copy link

alexxkn commented Apr 19, 2017

Hello!

I have the same problem.

I can't delete rsyslog in my virtual machine, because cloud-init requires rsyslog package.
So, if I use epel version of syslog-ng - everything is OK, but epel version is too old. If I use package from copr-be.cloud.fedoraproject.org/results/czanik, I've got same conflict as described above.

@faxm0dem
Copy link
Contributor

I can implement the %post script what do you think @czanik?

@czanik
Copy link
Contributor

czanik commented Apr 21, 2017

I updated my package, and now the two can be installed together:

[root@localhost ~]# cat /etc/system-release
CentOS Linux release 7.3.1611 (Core) 
[root@localhost ~]# rpm -qa | grep syslog
syslog-ng-3.9.1-2.el7.centos.x86_64
rsyslog-7.4.7-16.el7.x86_64
[root@localhost ~]# 

@alexxkn
Copy link

alexxkn commented Apr 21, 2017

That's great! Tanks a lot!

@czanik
Copy link
Contributor

czanik commented Apr 21, 2017

Related question: why would you install rsyslog and syslog-ng on the same box?

@alexxkn
Copy link

alexxkn commented Apr 21, 2017

I wrote about this above.
I can't delete rsyslog in my virtual machine in openstack, because cloud-init package requires rsyslog package.
if I delete both package, I missing part of control functionality.

@faxm0dem
Copy link
Contributor

I thought the dependency used to be on libvirt?

@mochrul
Copy link
Contributor

mochrul commented Apr 21, 2017

Which exact version of cloud-init do you use? Interestingly the fedora package does not depend on rsyslog but the centos version do. And in the changelog I saw some rsyslog log file parsing change, so the dependency seems genuine.

@alexxkn
Copy link

alexxkn commented Apr 26, 2017

$ yum info cloud-init
Installed Packages
Name        : cloud-init
Arch        : x86_64
Version     : 0.7.5
Release     : 10.el7.centos.1
Size        : 1.4 M
Repo        : installed
$ yum deplist cloud-init | grep syslog
dependency: rsyslog
provider: rsyslog.x86_64 7.4.7-16.el7

@Kokan
Copy link
Collaborator

Kokan commented Apr 2, 2018

I think this has been solved. Please reopen if you think it is still an issue.

@HanouaJ
Copy link

HanouaJ commented Sep 19, 2018

This issue still exists on syslog-ng-3.14.1 :

Transaction check error:
file /etc/logrotate.d/syslog from install of syslog-ng-3.14.1-4.el7.centos.x86_64 conflicts with file from package rsyslog-8.24.0-2.el7.centos.x86_64

@Kokan
Copy link
Collaborator

Kokan commented Sep 19, 2018

I just spin up a centos:latest docker and follow this https://www.syslog-ng.com/community/b/blog/posts/installing-latest-syslog-ng-on-rhel-and-other-rpm-distributions
I had no conflict, could you reproduce this in a container or VM (clean environment) ?

@HanouaJ
Copy link

HanouaJ commented Sep 20, 2018

Hi Kokan !

I have switched to version 3.17 of syslog-ng and it works fine, no conflict on the /etc/logrotate.d/syslog file.

@Kokan
Copy link
Collaborator

Kokan commented Sep 20, 2018

I am glad to hear it.

@oso24
Copy link

oso24 commented Jun 15, 2020

Hi,
up to relaese 3.22 it was fine. syslog-ng cloud be installed in parallel to an runing rsyslod. now I want to use version 3.27 and I got an confict:
Transaction check error:
file /etc/logrotate.d/syslog from install of syslog-ng-3.27.1-1.el7.x86_64 conflicts with file from package rsyslog-8.24.0-41.el7_7.2.x86_6
can you please check it.

@MrAnno
Copy link
Collaborator

MrAnno commented Jun 15, 2020

@oso24 I can reproduce the same with syslog-ng-3.27.1-1.el7.x86_64 and rsyslog-8.24.0-52.el7.x86_64.

We haven't changed anything logrotate-related in the RPM spec file between v3.22 and v3.27.

The actual conflict has been there for a long time, we seem to use the namesyslog for log rotation instead of syslog-ng (we do that in the deb packaging).
@czanik mentioned that:

I had long discussions with Red Hat about it, but renaming it to syslog-ng does not work.

I guess this problem was fixed by packaging the exact same logrotate file that rsyslog had.
This is the only thing that has changed since v3.22, the following must be the cause of the conflict:

--- a/syslog-ng.logrotate.3.22
+++ b/syslog-ng.logrotate.3.27
@@ -7,6 +7,6 @@
     missingok
     sharedscripts
     postrotate
-       /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
+       /usr/bin/systemctl kill -s HUP syslog-ng.service >/dev/null 2>&1 || true
     endscript
 }

@czanik Could you check it, please?

@MrAnno MrAnno reopened this Jun 15, 2020
@czanik
Copy link
Contributor

czanik commented Jun 15, 2020

Strange. I recall fixing this a few releases ago: RHEL 7 should have the "kill -HUP" version (the exact same file as in rsyslog for RHEL 7) and RHEL 8 & Fedora should have the "systemctl" version, but under a different file name.

OK, problem found. To have the above setup working, I had some local modifications to syslog-ng.spec and two copies for the logrotate file. Then after a larger upstream .spec file change I simply replaced my own with upstream, and my changes got lots.

There is another open logroate related ticket in RH bugzilla. I'll look into these later this week.

@czanik
Copy link
Contributor

czanik commented Jun 16, 2020

OK. A solution is available for testing, which solves both this issue and https://bugzilla.redhat.com/show_bug.cgi?id=1802165

  • Installs the same logrotate script on RHEL/CentOS 7 as rsyslog
  • On RHEL/CentOS 8 and Fedora the logrotate script is called syslog-ng and uses systemctl to reload syslog-ng after rotation, just as the rsyslog variant. It is in a separate subpackage, and installed only when rsyslog is not on the system (for reasons check the RH bugzilla ticket: in short it would not be used anyway due to conflicts)

The fix is currently available in my git snapshot repository at https://copr.fedorainfracloud.org/coprs/czanik/syslog-ng-githead/

If it works, I'll port this to the "official" syslog-ng package in EPEL 8

Please let me know your experiences with this fix!

@MrAnno
Copy link
Collaborator

MrAnno commented Jun 16, 2020

@czanik Thank you!

It works for me.
I've also checked the source RPM, it looks good to me.

Could you also create a patch, please, to keep packaging/rhel and dbld up-to-date?

@czanik
Copy link
Contributor

czanik commented Jun 16, 2020

Added three files, all with .txt appended to the filename, so I could upload:

  • spec.diff -- patch for the spec file, some changes seem to be unrelated (I modified the 3.27.1 release spec file, there might be some changes since that)
  • syslog-ng.logrotate7 -- logrotate script for RHEL 7 (identical to the one for rsyslog)
  • syslog-ng.logrotate -- logrotate script for RHEL 8 and Fedora

spec.diff.txt
syslog-ng.logrotate.txt
syslog-ng.logrotate7.txt

@MrAnno
Copy link
Collaborator

MrAnno commented Jun 16, 2020

Thanks, I'm opening a PR from it.

@oso24 Please let us know if something is wrong.

@sumedhpathak
Copy link

Is there an estimate on when a new release of syslog-ng with this fix for RHEL7 will be released? Thanks!

@czanik
Copy link
Contributor

czanik commented Jun 23, 2020

I just did another little change and waiting for feedback on it: https://lists.balabit.hu/pipermail/syslog-ng/2020-June/025949.html
Version 3.28.1 is expected to be released in the coming days, and those packages will contain the fix.

@pauliopolis
Copy link

Why is there no documentation anywhere for 3.5.6 in EPEL 🥲

@bazsi
Copy link
Collaborator

bazsi commented Nov 3, 2023

The documentation marks version dependencies, so you should be fine with the latest version of the documentation.

You can use the one on syslog-ng.com, but my preference is using the Axoflow edition here:

https://axoflow.com/docs/axosyslog-core/

Also, if you have questions you can ask here on github or use this discord server: https://discord.gg/vsCEkfaUk8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.