]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix CentOS logrotate script for systemd
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Apr 2018 09:17:32 +0000 (10:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Apr 2018 09:17:56 +0000 (10:17 +0100)
centos/rspamd.spec
centos/sources/rspamd.logrotate.systemd [new file with mode: 0644]

index d1d370327cb388b6ef63d1af3f3cc391106ffd49..b16e070deee25f4889618bd2d1c19bf7432ef215 100644 (file)
@@ -47,8 +47,10 @@ Requires(post): chkconfig
 Requires(preun): chkconfig, initscripts
 Requires(postun): initscripts
 Source1:        %{name}.init
-%endif
 Source2:        %{name}.logrotate
+%else
+Source2:        %{name}.logrotate.systemd
+%endif
 
 Source0:        https://rspamd.com/downloads/%{name}-%{version}.tar.xz
 Source3:       80-rspamd.preset
diff --git a/centos/sources/rspamd.logrotate.systemd b/centos/sources/rspamd.logrotate.systemd
new file mode 100644 (file)
index 0000000..f6536d0
--- /dev/null
@@ -0,0 +1,11 @@
+/var/log/rspamd/*log {
+    daily
+    rotate 10
+    missingok
+    notifempty
+    compress
+    sharedscripts
+    postrotate
+        export `systemctl -p MainPID show rspamd.service`; if [ -n "$MainPID" ]; then kill -USR1 $MainPID; fi
+    endscript
+}
\ No newline at end of file