]> git.pld-linux.org Git - packages/syslog-ng.git/commitdiff
more systemd fixes
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Tue, 3 Apr 2018 09:11:24 +0000 (11:11 +0200)
committerJacek Konieczny <j.konieczny@eggsoft.pl>
Tue, 3 Apr 2018 09:11:24 +0000 (11:11 +0200)
- aliases do not work for instanced unit, use dummy syslog-ng.service
instead
- don't try to stop systemd-kmsg-syslogd.service, it does not exist

syslog-ng-systemd.patch
syslog-ng.service [new file with mode: 0644]
syslog-ng.spec

index ee86c3c26c9b288628aaa25b0872242b5410f901..69f763d2d6bc1132fa4833f67a0cdd3c547b6572 100644 (file)
@@ -1,7 +1,7 @@
 diff -dur -x '*~' syslog-ng-syslog-ng-3.14.1.orig/contrib/systemd/syslog-ng@.service syslog-ng-syslog-ng-3.14.1/contrib/systemd/syslog-ng@.service
 --- syslog-ng-syslog-ng-3.14.1.orig/contrib/systemd/syslog-ng@.service 2018-02-26 15:32:28.000000000 +0100
 +++ syslog-ng-syslog-ng-3.14.1/contrib/systemd/syslog-ng@.service      2018-03-30 15:38:31.000000000 +0200
-@@ -5,13 +5,20 @@
+@@ -5,13 +5,17 @@
  
  [Service]
  Type=notify
@@ -12,14 +12,12 @@ diff -dur -x '*~' syslog-ng-syslog-ng-3.14.1.orig/contrib/systemd/syslog-ng@.ser
  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
-+ExecStartPre=-/bin/systemctl stop systemd-kmsg-syslogd.service
-+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
++ExecStart=/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
  Restart=on-failure
  
  [Install]
-+Alias=syslog-ng.service
 +DefaultInstance=default
- WantedBy=multi-user.target
+-WantedBy=multi-user.target
diff --git a/syslog-ng.service b/syslog-ng.service
new file mode 100644 (file)
index 0000000..3bf1f56
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=System Logger Daemon
+BindsTo=syslog-ng@default.service
+PropagatesReloadTo=syslog-ng@default.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/bin/systemctl start syslog-ng@default.service
+ExecStop=/bin/systemctl stop syslog-ng@default.service
+
+[Install]
+WantedBy=multi-user.target
index 8b3a6a650da1f429840b9f22b8c22f3782142368..4df9095a05e85420602b29707b53d3832276a7fd 100644 (file)
@@ -59,6 +59,7 @@ Source4:      http://www.balabit.com/support/documentation/syslog-ng-ose-%{docmver}-g
 Source5:       %{name}-simple.conf
 Source6:       https://github.com/buytenh/ivykis/archive/v%{libivykis_version}/ivykis-%{libivykis_version}.tar.gz
 # Source6-md5: aeafef422d8dafb84e1fcd16f9f4822e
+Source7:       syslog-ng.service
 Patch0:                %{name}-datadir.patch
 Patch1:                cap_syslog-vserver-workaround.patch
 Patch2:                %{name}-nolibs.patch
@@ -439,6 +440,7 @@ ln -snf %{slibdir}/$(basename $RPM_BUILD_ROOT%{slibdir}/libsecret-storage.so.*.*
 %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng
 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf
 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng
+cp -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}
 
 for n in cron daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog; do
        > $RPM_BUILD_ROOT/var/log/$n
@@ -475,20 +477,20 @@ fi
 /sbin/chkconfig --add syslog-ng
 %service syslog-ng restart "syslog-ng daemon"
 
-%systemd_post syslog-ng@.service
+%systemd_post syslog-ng@.service syslog-ng.service
 
 %preun
 if [ "$1" = "0" ]; then
        %service syslog-ng stop
        /sbin/chkconfig --del syslog-ng
 fi
-%systemd_preun syslog-ng@.service
+%systemd_preun syslog-ng@.service syslog-ng.service
 
 %postun
 %systemd_reload
 
 %triggerpostun -- syslog-ng < 3.3.4-3
-%systemd_trigger syslog-ng@.service
+%systemd_trigger syslog-ng@.service syslog-ng.service
 
 %triggerun -- syslog-ng < 3.0
 sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf
@@ -520,6 +522,7 @@ exit 0
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng
 %attr(754,root,root) /etc/rc.d/init.d/syslog-ng
 %{systemdunitdir}/syslog-ng@.service
+%{systemdunitdir}/syslog-ng.service
 %dir %{moduledir}
 %attr(755,root,root) %{moduledir}/libadd-contextual-data.so
 %if %{with amqp}
This page took 0.059431 seconds and 4 git commands to generate.