Bug 735108

Summary: consider using upstream supplied syslog-ng.service systemd unit file
Product: [Fedora] Fedora Reporter: Lennart Poettering <lpoetter>
Component: syslog-ngAssignee: Matthias Runge <mrunge>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jose.p.oliveira.oss, mrunge, mschmidt, rayvd, silfreed
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-27 13:18:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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