rsyslog-pkg-rhel-centos icon indicating copy to clipboard operation
rsyslog-pkg-rhel-centos copied to clipboard

RHEL 7 packages need fix

Open rgerhards opened this issue 9 years ago • 23 comments

There are a couple of issues when trying to use them as a drop-in replacement for the Red Hat provided ones. For example, imjournal is used by default by RH, but we yet don't even provide a package for it (see https://github.com/rsyslog/rsyslog-pkg-rhel-centos/issues/9).

To fix all of this, we need to install a plain RHEL 7 (or CentOS) and work to see which issues show up when we try to use user packages ... and then fix them ;)

rgerhards avatar Oct 28 '15 17:10 rgerhards

Perhaps a path forward here would be to first reconcile with how Fedora builds and packages rsyslog. See http://pkgs.fedoraproject.org/cgit/rsyslog.git/

Since the RHELs flow from Fedora, it might be time well spent getting this repository to be a superset of Fedora, and perhaps even getting Fedora to keep there spec file up-to-date with this repo.

portante avatar Nov 06 '15 02:11 portante

Well, I have tried to build RHEL 7 packages on a Fedora 21 box but have run into too many problems with the source code references. The latest is that libgt's source reference refers to a master.zip file which has a top level directory of libgt-master when the spec file wants to see libgt-0.3.11. And once that is addressed, then libgt now needs autoconf run to convert the configure.ac to a runnable configure script that the build process can use.

portante avatar Nov 06 '15 17:11 portante

Okay, here is a patch for hacking libgt spec to work:

From 07bb330378a43c39f4bf318f757315c11b4e0ca5 Mon Sep 17 00:00:00 2001
From: Peter Portante <[email protected]>
Date: Fri, 6 Nov 2015 23:21:18 +0000
Subject: [PATCH] Initial pass at getting libgt spec file working

---
 rpmbuild/SPECS/libgt.spec | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rpmbuild/SPECS/libgt.spec b/rpmbuild/SPECS/libgt.spec
index 882e3d3..5015a18 100644
--- a/rpmbuild/SPECS/libgt.spec
+++ b/rpmbuild/SPECS/libgt.spec
@@ -5,8 +5,11 @@ Release: 1%{?dist}
 License: Apache Software License
 Group:      Networking/Admin
 URL: http://www.rsyslog.com/
-Source0: https://github.com/rsyslog/libgt/archive/master.zip 
+Source0: https://github.com/rsyslog/libgt/archive/libgt-0.3.11.tar.xz
 BuildRoot:  /var/tmp/%{name}-build
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
 BuildRequires: openssl-devel
 BuildRequires: curl-devel
 Requires: /sbin/ldconfig
@@ -27,6 +30,7 @@ needed to develop applications using libgt.

 %prep
 %setup -q
+autoreconf --force --verbose --install

 %build
 %configure 
-- 
2.1.0

portante avatar Nov 06 '15 23:11 portante

I don't know if this is useful, but I was able to get an rsyslog build for epel7 going via COPR:

https://copr.fedoraproject.org/coprs/portante/rsyslog-v8-stable/

This is a mashup of the v8-stable .spec file with the Fedora .spec file, and the addition of mmutf8fix that I was looking for as well. I'll be feeding backwhat it took to get this all working in the COPR environment.

portante avatar Nov 08 '15 18:11 portante

My apologies on placing my initial issues in the wrong spot. Hopefully you guys can move them around on the admin side without too much trouble. I've documented some of the items I've had to fix from the RPMS that are provided.

https://github.com/rsyslog/rsyslog/issues/645 https://github.com/rsyslog/rsyslog/issues/646

Additionally, another item I've had to change is integration with systemd journald. Edit /etc/rsyslog.conf:

... module(load="imuxsock" SysSock.Name="/run/systemd/journal/syslog") ...

I'm still looking at a warning thrown when rsyslog is stopped (after added my fixes from issues 645/646) related to syslog.socket.

Kryai avatar Nov 30 '15 19:11 Kryai

@Kryai, not sure you need to be explicit about the socket, though it can't hurt, as it seems that on most systems I have encountered /dev/log is a link to /run/systemd/journal/syslog.

portante avatar Nov 30 '15 20:11 portante

@portante, you are right, that config actually isn't required strictly. I was working on our rsyslog config for RHEL7 a few months ago and took up the task yet again today - I think I got my lines crossed somewhere - I've removed it from my config since it is extraneous.

/dev/log however is a straightforward socket and not a link to /run/systemd/journal/syslog.

My issue from earlier with being unable to stop rsyslog has returned unfortunately. It appears that if /run/systemd/journal/syslog exists - rsyslog exits with a return of 1. I can 'rm /run/systemd/journal/syslog' and then run 'systemctl stop rsyslogd' successfully - I've not looked into why yet or how that might be meaningful.

Here's what it looks like when systemd restarts the process after being stopped.

Nov 30 15:13:25 daemon.notice testing2 systemd[1]: rsyslog.service: control process exited, code=exited status=1 Nov 30 15:13:25 daemon.info testing2 systemd[1]: Starting System Logging Service... Nov 30 15:13:25 daemon.notice testing2 systemd[1]: Unit rsyslog.service entered failed state. Nov 30 15:13:25 daemon.info testing2 systemd[1]: Starting System Logging Service... Nov 30 15:13:25 daemon.info testing2 systemd[1]: Started System Logging Service.

I'm still looking into the actual underlying issue when I get free cycles.

Kryai avatar Nov 30 '15 21:11 Kryai

So I cheated a bit and looked at the default CentOS7 rsyslog service file - it appears they do comment out the directive "Require=syslog.socket"

So far it appears everything works again with this removed. I'll run this way for a while and see if anything appears to be broken.

Items that need to be fixed/considered for RHEL7/systemd packaging:

  1. Comment out "Requires=syslog.socket" in /usr/lib/systemd/system/rsyslog.service
  2. Source in environmental variable from /etc/sysconfig/rsyslog. Add "EnvironmentFile" to /usr/lib/systemd/system/rsyslog.service (Stolen from RHEL7 default config, seems like a good idea, I used it to enable debugging for rsyslog, the default file has no variables set so this does nothing in the default config, you still need to add options appropriately if you want them)
  3. Add "ExecStop" directive in /usr/lib/systemd/system/rsyslog.service
  4. Add "ExecReload" directive in /usr/lib/systemd/system/rsyslog.service
  5. Modify "ExecStart" to change PID file to be compatible with existing logrotate configuration.

Here's my config for rsyslog.service

[Unit]
Description=System Logging Service
;Requires=syslog.socket
Documentation=man:rsyslogd(8)
Documentation=http://www.rsyslog.com/doc/

[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/rsyslog
ExecStart=/sbin/rsyslogd -n -i /var/run/syslogd.pid $SYSLOGD_OPTIONS
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null
Restart=on-failure

[Install]
WantedBy=multi-user.target
Alias=syslog.service

I'm not sure why you can't use "cat /var/run/syslogd.pid" in ExecReload, while it works normally in ExecStop. $MAINPID however appears to do what is intended for both situations.

Kryai avatar Nov 30 '15 22:11 Kryai

As an update - with the above config and my rsyslog.conf, I am not getting systemd-journald messages.

If I start up the syslog.socket, I do start to get systemd-journald but then I lose messages from say the 'logger' command. I am at a loss with how to configure them to function properly. I rebuilt rsyslog with support for imjournal but have not been able to get that working as desired either. I'm getting fairly frustrated unfortunately after trying multiple configurations and options.

Does anyone have a working configuration with RHEL7 w/systemd that isn't the provided from Red Hat?

Kryai avatar Dec 02 '15 23:12 Kryai

I have built 8.14 in Fedora COPR against F21 and EPEL 7, see https://copr.fedoraproject.org/coprs/portante/rsyslog-v8.14.0-case-sensitivity-support/

If that is of interest to you, I can share with you what I did. I'll be posting in my github report the changes I made to Fedora's rsyslog.spec file to get this all working.

-peter

On Wed, Dec 2, 2015 at 6:16 PM, Kryai [email protected] wrote:

As an update - with the above config and my rsyslog.conf, I am not getting systemd-journald messages.

If I start up the syslog.socket, I do start to get systemd-journald but then I lose messages from say the 'logger' command. I am at a loss with how to configure them to function properly. I rebuilt rsyslog with support for imjournal but have not been able to get that working as desired either. I'm getting fairly frustrated unfortunately after trying multiple configurations and options.

Does anyone have a working configuration with RHEL7 w/systemd that isn't the provided from Red Hat?

— Reply to this email directly or view it on GitHub https://github.com/rsyslog/rsyslog-pkg-rhel-centos/issues/15#issuecomment-161464162 .

portante avatar Dec 03 '15 00:12 portante

@portante - It is of interest to me, I'm grabbing the src.rpm and will start taking a look at your changes. It would be great to take a look at the work you've done.

Kryai avatar Dec 03 '15 14:12 Kryai

@portante can you describe the changes you made, so we can probably adapt them to the Adiscon packages?

friedl avatar Dec 03 '15 14:12 friedl

@Kryai, @friedl, and @theinric, take a look at: https://github.com/portante/rsyslog-fedora/tree/v8.14-updates

I would think that we could work to get Adiscon and Fedora spec files to track much more closely with a little work.

portante avatar Dec 03 '15 16:12 portante

@portante I've built https://copr.fedoraproject.org/coprs/portante/rsyslog-v8.14.0-case-sensitivity-support/ on CentOS7, with some modifications to the spec file, it was not exactly compatible out of the box - and it appears that 'logger' issues messages are not delivered to /var/log/messages. It appears to have the same problems that I've been fighting the last couple days.

Kryai avatar Dec 03 '15 18:12 Kryai

So do you have a /dev/log socket on that box?

On Thu, Dec 3, 2015 at 1:53 PM, Kryai [email protected] wrote:

@portante https://github.com/portante I've built https://copr.fedoraproject.org/coprs/portante/rsyslog-v8.14.0-case-sensitivity-support/ on CentOS7, with some modifications to the spec file, it was not exactly compatible out of the box - and it appears that 'logger' issues messages are not delivered to /var/log/messages. It appears to have the same problems that I've been fighting the last couple days.

— Reply to this email directly or view it on GitHub https://github.com/rsyslog/rsyslog-pkg-rhel-centos/issues/15#issuecomment-161746055 .

portante avatar Dec 03 '15 21:12 portante

I didn't at the time no, not sure why, good call - rebooted and it was created properly. This time everything worked.

I'll make a list shortly with a few issues I came upon building your fork as well as other items I think should be added that incorporated.

Kryai avatar Dec 03 '15 21:12 Kryai

rsyslog.spec “liblogging-stdlog-devel” should be “liblogging-devel” - it looks like fedora has this package built differently, the rsyslog repo however has this built in the second fashion. “liblognorm-devel” should be “liblognorm1-devel” - another package naming error

I took a look at your rsyslog.service as well as the logrotate config, and they are compatible so you don't need to make additional changes there if you don't want to. All of my tests are passing currently, but I'll add our more complex configuration and see how it fares for some time.

Kryai avatar Dec 03 '15 23:12 Kryai

@Kryai, thanks, glad that /dev/log thing worked, as I trashed my logging on a box a couple times because I mistakenly removed /dev/log somehow.

Yes, the Fedora -stdlog- thing flummoxed me, so I just built it directly to get around it. :(

Those should have come from Fedora, so double check that rsyslog rotation is working properly on your boxes, I found that I did not have the right pid file specified in the /etc/logrotate.d/syslog file.

portante avatar Dec 04 '15 01:12 portante

for the -stdlog- item, you can make the changes that I specified into the spec file and it'll be resolved. Just a minor issue.

the /etc/logrotate.d/syslog file is integrated with systemd so you actually don't even need the PID file specified, and it is not. It is a full integration which is probably a good thing.

I think this will satisfy the issues with RHEL7 building properly. It's probably a good idea to merge them in now and get some wider testing in perhaps by more RHEL/Fedora guys. On a side note, I'm happy to keep testing but I will be out for vacation for some time coming up after today.

Kryai avatar Dec 04 '15 14:12 Kryai

Thanks @Kryai, I'll check this out and see how we can get this moved upstream in Fedora. @theinric, perhaps you can help me do that?

portante avatar Dec 04 '15 15:12 portante

Just to be clear, my comments were related to the RHEL7 items for rsyslog's branch to make a working spec/config files for RHEL7 hopefully in 8.15.0? Fedora will have additional issues to work through related to that package naming I've mentioned, I've performed no testing on there unfortunately. I'm not sure why that -stdlog- difference is present in their build of that package, but if the packages are available, the spec may not need any changes, but some consistency would be a good idea.

Kryai avatar Dec 04 '15 15:12 Kryai

Hi.

Don't know if close-related, but we noticed our centos7 rsyslog 8.30 was unable to forward traffic when run from init.d/systemd (service rsyslog start/systemctl rsyslog start) but works when run from terminal with "-n".

mostolog avatar Oct 23 '17 10:10 mostolog

@mostolog Not sure if the two are related, but I had a few boxes that failed to forward messages properly if rsyslog started up before the network was available. I had to introduce an artificial delay to work around that issue (rsyslog/rsyslog#1656).

deoren avatar Oct 23 '17 13:10 deoren