Discussion:
Need help making syslog-ng, rsyslog, and sysklogd not conflict
Douglas E. Warner
2008-08-12 18:06:12 UTC
Permalink
I've been sitting on an update to syslog-ng for quite awhile now because I
haven't been able to make syslog-ng compatible with simultaneous installations
of rsyslog or sysklogd (RHEL).

The root of the problem is that currently you can't install syslog-ng along
side of either of the other two syslog providers since both packages installs
their own logrotate files that rotate the same log files resulting in double
log rotation.

I've tried updating my syslog-ng package to include the logrotate file of each
of the other packages, but this still conflicts on RHEL-based boxes and when
sysklogd gets an update, syslog-ng gets silently removed (RPM does it without
reporting that it happened or yum saying it will happen).

Any ideas how I can make these packages installable at the same time?

-Doug

Sources: https://rpm.silfreed.net:8002/file/tip/syslog-ng/
Packages: http://www.silfreed.net/download/repo/packages/syslog-ng/
(syslog-ng 2.0.9-3 is the latest)
Repo release files:
http://www.silfreed.net/download/repo/packages/silfreednet-release/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080812/6e25b2bb/attachment.bin
Jeroen van Meeuwen
2008-08-12 22:59:58 UTC
Permalink
Post by Douglas E. Warner
I've been sitting on an update to syslog-ng for quite awhile now because I
haven't been able to make syslog-ng compatible with simultaneous installations
of rsyslog or sysklogd (RHEL).
The root of the problem is that currently you can't install syslog-ng along
side of either of the other two syslog providers since both packages installs
their own logrotate files that rotate the same log files resulting in double
log rotation.
I've tried updating my syslog-ng package to include the logrotate file of each
of the other packages, but this still conflicts on RHEL-based boxes and when
sysklogd gets an update, syslog-ng gets silently removed (RPM does it without
reporting that it happened or yum saying it will happen).
Any ideas how I can make these packages installable at the same time?
Should these packages even be installable at the same time?

Kind regards,

Jeroen van Meeuwen
-kanarip
Jesse Keating
2008-08-12 23:07:43 UTC
Permalink
Post by Jeroen van Meeuwen
Should these packages even be installable at the same time?
One underlying Fedora policy is no conflicting packages.
--
Jesse Keating
Fedora -- Freedom? is a feature!
identi.ca: http://identi.ca/jkeating
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080812/a1766875/attachment.bin
Douglas E. Warner
2008-08-12 23:39:57 UTC
Permalink
Post by Jeroen van Meeuwen
Should these packages even be installable at the same time?
The only thing that conflicts here is the log rotation script.

I've been told that shipping the *exact same* log rotate script as rsyslog or
sysklogd should work as rpm won't care about the duplicate file since it
matches exactly, but there's two problems here:
1) I don't know what "exact" is (file size, md5, timestamp, ??)
2) So far it doesn't work in practice.

So if this is definitely supposed to work I need to figure out how "exact" the
file needs to be.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080812/d3605d4a/attachment.bin
Jason L Tibbitts III
2008-08-13 00:06:11 UTC
Permalink
DEW> The only thing that conflicts here is the log rotation script.

If you just want the same log rotation script regardless of which of
the syslog daemons you install, just split that script into a separate
package and have the three syslog packages depend on it. Certainly
not the worst hack which could be employed to solve this issue.

- J<
Douglas E. Warner
2008-08-13 00:08:21 UTC
Permalink
Post by Jason L Tibbitts III
If you just want the same log rotation script regardless of which of
the syslog daemons you install, just split that script into a separate
package and have the three syslog packages depend on it. ?Certainly
not the worst hack which could be employed to solve this issue.
Not possible since Red Hat controls sysklogd in RHEL.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080812/41a2a6a9/attachment.bin
Jason L Tibbitts III
2008-08-13 00:13:48 UTC
Permalink
DEW> Not possible since Red Hat controls sysklogd in RHEL.

And here I was thinking I was posting to fedora-devel-list.

Could we discuss technical solutions and ignore Red Hat politics?
What I proposed is a standard method of dealing with these things. We
have modified several packages in the same manner (mainly to make use
of -filesystem packages), and those packages are also in RHEL. It
hasn't been an issue.

- J<
Jarod Wilson
2008-08-13 01:41:15 UTC
Permalink
Post by Jason L Tibbitts III
DEW> Not possible since Red Hat controls sysklogd in RHEL.
And here I was thinking I was posting to fedora-devel-list.
Could we discuss technical solutions and ignore Red Hat politics?
What I proposed is a standard method of dealing with these things. We
have modified several packages in the same manner (mainly to make use
of -filesystem packages), and those packages are also in RHEL. It
hasn't been an issue.
I was just about to suggest a common log rotation scripts package that all
syslog progs used as well. And yeah, don't worry what RHEL does right now.
--
Jarod Wilson
jwilson at redhat.com
Dmitry Butskoy
2008-08-13 11:27:11 UTC
Permalink
Post by Jarod Wilson
I was just about to suggest a common log rotation scripts package that
all syslog progs used as well.
Hmm...

syslog used:

/bin/kill -HUP `cat /var/run/syslogd.pid`

in logrotate's postrotate scripts, whereas rsyslog uses

/bin/kill -HUP `cat /var/run/rsyslogd.pid`

now. (Note differ pid filename).

In other words, is it possible (in general) to create common logrotate
files for all syslog-like packages?


~buc
http://www.fedoraproject.org/wiki/DmitryButskoy
Douglas E. Warner
2008-08-13 14:12:54 UTC
Permalink
Post by Dmitry Butskoy
In other words, is it possible (in general) to create common logrotate
files for all syslog-like packages?
Possibly not for *all* syslog packages, but it would be possible for the sets
that are available.

Currently it's just this:
Fedora: syslog-ng and rsyslog
RHEL: syslog-ng and sysklogd

But then again, there's nothing stopping rsyslog from being made available for
RHEL either, so a solution that allowed all three to be installable at the
same time would be the most ideal.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080813/e1ba21fe/attachment.bin
Chris Adams
2008-08-13 14:32:25 UTC
Permalink
Post by Douglas E. Warner
Fedora: syslog-ng and rsyslog
RHEL: syslog-ng and sysklogd
RHEL 5.2 added rsyslog. Also, I don't see syslog-ng in RHEL (or EPEL).
--
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.
Douglas E. Warner
2008-08-13 14:41:07 UTC
Permalink
RHEL 5.2 added rsyslog. ?Also, I don't see syslog-ng in RHEL (or EPEL).
No, it's not in EPEL yet, but I do have a number of people using it from my
repository.

I didn't realize RHEL 5.2 added rsyslog; I'll have to see if they did anything
to make them both installable at the same time.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080813/5c415d6a/attachment.bin
Chris Adams
2008-08-13 15:13:02 UTC
Permalink
Post by Douglas E. Warner
I didn't realize RHEL 5.2 added rsyslog; I'll have to see if they did anything
to make them both installable at the same time.
I see it now; the logrotate script from both packages is the same and
attempts to HUP both daemons:

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}


Maybe instead any system logger could symlink the PID file to a common
name in the init script? I.e.:

start() {
...
daemon syslogd $SYSLOGD_OPTIONS
ln -s /var/run/syslogd.pid /var/run/system-logger.pid
}


Then the logrotate config could just use that file (and be included
somewhere other than the various syslog packages).

I don't think it is valid to have more than one syslog type daemon
running at once, is it?
--
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.
Douglas E. Warner
2008-08-13 18:00:57 UTC
Permalink
Post by Chris Adams
I don't think it is valid to have more than one syslog type daemon
running at once, is it?
It's not valid, but I don't think the service scripts should break if someone
accidentally does it.

I think your suggestion of symlinking the common name so the logrotate script
rotates the active one but the service script still uses a package-specific
pid file is great. We could probably take that one step farther and write
some common service handler scripts to re-link the syslogd.pid file to the
proper daemon so accidents with starting multiple daemons and then shutting
down one doesn't remove the symlink completely.

Thanks for the great idea; I'll see if I can work with the other two packagers
to get this going.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080813/1e55eab9/attachment.bin
Chris Adams
2008-08-13 18:13:01 UTC
Permalink
Post by Douglas E. Warner
Post by Chris Adams
I don't think it is valid to have more than one syslog type daemon
running at once, is it?
It's not valid, but I don't think the service scripts should break if someone
accidentally does it.
I guess what I mean is will a second daemon even start? I know if you
set them for remote reception, only one will start; the second will fail
trying to bind the network socket. What happens if you try to start two
listening locally?
--
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.
Jeroen van Meeuwen
2008-08-14 21:41:33 UTC
Permalink
Post by Douglas E. Warner
Post by Dmitry Butskoy
In other words, is it possible (in general) to create common logrotate
files for all syslog-like packages?
Possibly not for *all* syslog packages, but it would be possible for the sets
that are available.
Fedora: syslog-ng and rsyslog
RHEL: syslog-ng and sysklogd
But then again, there's nothing stopping rsyslog from being made available for
RHEL either, so a solution that allowed all three to be installable at the
same time would be the most ideal.
Also, I'm getting sysklogd back in Fedora.

Kind regards,

Jeroen van Meeuwen
-kanarip

Douglas E. Warner
2008-08-13 11:27:20 UTC
Permalink
Post by Jason L Tibbitts III
And here I was thinking I was posting to fedora-devel-list.
Could we discuss technical solutions and ignore Red Hat politics?
What I proposed is a standard method of dealing with these things. ?We
have modified several packages in the same manner (mainly to make use
of -filesystem packages), and those packages are also in RHEL. ?It
hasn't been an issue.
Ideally syslog-ng would be in EPEL instead of only being available from my
repository, and as it is I can't ship it due to this conflict. Last I knew,
EPEL was a Fedora initiative.

At any rate, I appreciate the suggestions; I just happen to be stuck with a
complicated problem.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080813/eb491502/attachment.bin
Jason L Tibbitts III
2008-08-13 13:02:20 UTC
Permalink
DEW> Ideally syslog-ng would be in EPEL instead of only being
DEW> available from my repository, and as it is I can't ship it due to
DEW> this conflict.

Finding the correct technical solution to the problem in Fedora should
be paramount. After a good non-hackish solution which folks here
agree upon has been implemented, you can then approach the RHEL
engineers.

DEW> Last I knew, EPEL was a Fedora initiative.

Keeping reasonable technical fixes for real problems out of Fedora
simply because the EPEL/RHEL interface may have additional issues is
counterproductive. If the RHEL engineers won't accommodate the
technically preferred solution, then you can raise that issue here or
with FESCo or the board if necessary. Do you even know that they
object to a reasonable solution? Have you presented it to them?

- J<
Douglas E. Warner
2008-08-13 14:16:59 UTC
Permalink
Post by Jason L Tibbitts III
Keeping reasonable technical fixes for real problems out of Fedora
simply because the EPEL/RHEL interface may have additional issues is
counterproductive. ?If the RHEL engineers won't accommodate the
technically preferred solution, then you can raise that issue here or
with FESCo or the board if necessary. ?Do you even know that they
object to a reasonable solution? ?Have you presented it to them?
I agree that I would like to find the best technical solution; I'm just not
sure that a "syslog-logrotate" package is it. As pointed out in a different
part of this thread, even sysklogd and rsyslog have different log rotation
scripts due to restarting a different daemon.

It was previously suggested that all three should use the same pid file and
therefor be able to be restarted by the logrotate script regardless of which
one was running. I don't like this method since it creates a problem if
someone accidentally starts two syslog daemons at the same time.

I don't mind contacting the Red Hat person in charge of sysklogd if we find a
good solution; I just feel it would be unlikely to get a change to such a core
package into RHEL.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20080813/d54b7cac/attachment.bin
Benny Amorsen
2008-08-13 22:21:55 UTC
Permalink
Post by Douglas E. Warner
It was previously suggested that all three should use the same pid file and
therefor be able to be restarted by the logrotate script regardless of which
one was running. I don't like this method since it creates a problem if
someone accidentally starts two syslog daemons at the same time.
It's not just a case of "accidentally". syslog-ng is great for
handling remote logs, but regular rsyslog is nice for its simple
configuration. I run rsyslog on all the regular servers, and both
rsyslog and syslog-ng on the log-server.

yum doesn't like that very much, but I just beat it into submission.


/Benny
Ville Skyttä
2008-08-13 08:30:05 UTC
Permalink
Post by Douglas E. Warner
I've been told that shipping the *exact same* log rotate script as rsyslog
or sysklogd should work as rpm won't care about the duplicate file since it
1) I don't know what "exact" is (file size, md5, timestamp, ??)
I'm not sure if it's considered good packaging practice in cases like this,
but at least for "rpm -V", and also IIRC wrt. file conflicts, the sameness as
far as rpm is concerned can be controlled to some extent in %files with
the %verify directive.

http://rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-VERIFY-DIRECTIVE
Loading...