[packages/syslog-ng] fix systemd unit template file

jajcus jajcus at pld-linux.org
Tue Apr 3 10:26:56 CEST 2018


commit bbf3801ff5df4a5a9e7ec37db9b198f7e785b495
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Fri Mar 30 15:55:44 2018 +0200

    fix systemd unit template file
    
    - use syslog-ng at default.service as syslog-ng.service (instead
      of the init.d script)
    - make extra instances usable (do not force single config and pid file)

 syslog-ng-systemd.patch | 14 ++++++++++----
 syslog-ng.spec          |  2 ++
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/syslog-ng.spec b/syslog-ng.spec
index 9db92bf..bc9cb48 100644
--- a/syslog-ng.spec
+++ b/syslog-ng.spec
@@ -441,6 +441,7 @@ for n in cron daemon debug iptables kernel lpr maillog messages secure spooler s
 	> $RPM_BUILD_ROOT/var/log/$n
 done
 touch $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+ln -s "%{name}" $RPM_BUILD_ROOT/etc/sysconfig/%{name}@default
 
 %{__rm} $RPM_BUILD_ROOT%{_sbindir}/syslog-ng-debun
 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/syslog-ng-debun.1
@@ -508,6 +509,7 @@ exit 0
 %doc contrib/syslog-ng.conf.{doc,simple,RedHat}
 %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-ose-v%{docmver}-guide-admin.pdf
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}@default
 %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng
 %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng/patterndb.d
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/scl.conf
diff --git a/syslog-ng-systemd.patch b/syslog-ng-systemd.patch
index e61e960..ee86c3c 100644
--- a/syslog-ng-systemd.patch
+++ b/syslog-ng-systemd.patch
@@ -1,14 +1,19 @@
 diff -dur -x '*~' syslog-ng-syslog-ng-3.14.1.orig/contrib/systemd/syslog-ng at .service syslog-ng-syslog-ng-3.14.1/contrib/systemd/syslog-ng at .service
 --- syslog-ng-syslog-ng-3.14.1.orig/contrib/systemd/syslog-ng at .service	2018-02-26 15:32:28.000000000 +0100
-+++ syslog-ng-syslog-ng-3.14.1/contrib/systemd/syslog-ng at .service	2018-03-30 15:26:03.000000000 +0200
-@@ -7,11 +7,14 @@
++++ syslog-ng-syslog-ng-3.14.1/contrib/systemd/syslog-ng at .service	2018-03-30 15:38:31.000000000 +0200
+@@ -5,13 +5,20 @@
+ 
+ [Service]
  Type=notify
++Environment=CONFIG_FILE=/etc/syslog-ng/syslog-ng.conf
++Environment=PID_FILE=/var/run/syslogd.pid
++Environment=PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
++Environment=CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
  EnvironmentFile=-/etc/default/syslog-ng@%i
  EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
 -ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
-+EnvironmentFile=-/etc/sysconfig/syslog-ng
 +ExecStartPre=-/bin/systemctl stop systemd-kmsg-syslogd.service
-+ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile /etc/syslog-ng/syslog-ng.conf -p /var/run/syslogd.pid --worker-threads=1024 $SYSLOGNG_OPTS
++ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE --worker-threads=1024 $SYSLOGNG_OPTS
  ExecReload=/bin/kill -HUP $MAINPID
  StandardOutput=journal
  StandardError=journal
@@ -16,4 +21,5 @@ diff -dur -x '*~' syslog-ng-syslog-ng-3.14.1.orig/contrib/systemd/syslog-ng at .ser
  
  [Install]
 +Alias=syslog-ng.service
++DefaultInstance=default
  WantedBy=multi-user.target
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/syslog-ng.git/commitdiff/6599601ca6df31bf69056287048d5f7029d30f35



More information about the pld-cvs-commit mailing list