Bug 735108 - consider using upstream supplied syslog-ng.service systemd unit file
Summary: consider using upstream supplied syslog-ng.service systemd unit file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: syslog-ng
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matthias Runge
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-01 14:07 UTC by Lennart Poettering
Modified: 2012-04-27 13:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-27 13:18:15 UTC


Attachments (Terms of Use)

Description Lennart Poettering 2011-09-01 14:07:19 UTC
syslog-ng appears to include a syslog-ng.service file shipped along the upstream package. I think it would make a lot of sense using that file and patching it as necessary, instead of shipping our own, in order to keep differences between the distributions minimal.

Comment 1 Matthias Runge 2011-09-02 06:19:07 UTC
I guess, this regards also to f15 and f16 packages.

Comment 2 Jose Pedro Oliveira 2011-09-02 09:56:52 UTC
Hi,

We can't ship the upstream syslog-ng.service file as we need to override the default syslog-ng pid file. This is needed to avoid conflicts between the several syslog daemons available: by having all (rsyslog, syslog-ng and sysklogd) using the same pid file, we can ship the same logrotate file and thus avoiding file conflicts.

/jpo

Comment 3 Lennart Poettering 2011-09-05 23:44:09 UTC
That's why I suggested using it but patching it as necessary. Keeping the difference to upstream minimal does not have to mean to keep them at zero.

Comment 4 Michal Schmidt 2011-12-14 22:45:27 UTC
Enforcing the pid file path looks like a good enough reason to patch the unit file. But why do you add the configurability using /etc/sysconfig/syslog-ng?:

SYSLOGNG_OPTIONS="-F -p /var/run/syslogd.pid"

Having the sysconfig file just creates the impression that the user is free to change the pid file path. Why would he want to do that? Especially since changing it would break the assumption of the logrotate script. This looks like an option that the user should not be encouraged to touch.

The case for keeping the "-F" option directly in the unit file is even stronger. If the user deletes it from SYSLOGNG_OPTIONS, the service will break.

/etc/sysconfig/syslog-ng should not exist. The options that are there in the default setup should be in the unit file directly.

Comment 5 Jose Pedro Oliveira 2011-12-15 02:41:48 UTC
(In reply to comment #4)
> Enforcing the pid file path looks like a good enough reason to patch the unit
> file. But why do you add the configurability using /etc/sysconfig/syslog-ng?:

Old habits (and also having to support RHEL systems).

> SYSLOGNG_OPTIONS="-F -p /var/run/syslogd.pid"
> 
> Having the sysconfig file just creates the impression that the user is free to
> change the pid file path. Why would he want to do that? Especially since
> changing it would break the assumption of the logrotate script. This looks like
> an option that the user should not be encouraged to touch.

Yes, not encouraged to touch if wants to have both the rsyslog and the syslog-ng (and even the olg sysklogd) rpms installed. But if he knows what is doing he can even have several syslog daemons active at the same system; and it is a lot easier if he removes rsyslog after installing syslog-ng: then he can do whatever he likes to the configuration files.

> 
> The case for keeping the "-F" option directly in the unit file is even
> stronger. If the user deletes it from SYSLOGNG_OPTIONS, the service will break.
> 
> /etc/sysconfig/syslog-ng should not exist. The options that are there in the
> default setup should be in the unit file directly.

I agree with you: there is no point in keeping the sysconfig file around in systemd systems.  I will to release a new syslog-ng SRPM without the sysconfig file.

/jpo

Comment 6 Jose Pedro Oliveira 2011-12-15 03:08:31 UTC
New rawhide release:

 * syslog-ng-3.2.5-3.fc17
   http://koji.fedoraproject.org/koji/buildinfo?buildID=278885

Comment 7 Jose Pedro Oliveira 2012-04-27 13:18:15 UTC
Patch being applied against the upstream service file (for Fedora >= 17):

----------
--- syslog-ng-3.2.5/contrib/systemd/syslog-ng.service	2011-10-23 07:48:18.000000000 +0100
+++ syslog-ng-3.2.5-modified/contrib/systemd/syslog-ng.service	2011-12-15 02:25:38.598337205 +0000
@@ -4,7 +4,7 @@
 [Service]
 Sockets=syslog.socket
 ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service
-ExecStart=/usr/sbin/syslog-ng -F
+ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslogd.pid
 ExecReload=/bin/kill -HUP $MAINPID
 StandardOutput=null
----------


Current syslog-ng NVR:

 * syslog-ng-3.2.5-14.fc17


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