]> source.dussan.org Git - rspamd.git/commitdiff
[Rework] Remove systemd socket activation 762/head
authorAndrew Lewis <nerf@judo.za.org>
Wed, 27 Jul 2016 15:43:45 +0000 (16:43 +0100)
committerAndrew Lewis <nerf@judo.za.org>
Wed, 27 Jul 2016 15:43:45 +0000 (16:43 +0100)
CMakeLists.txt
centos/rspamd.spec
centos/sources/80-rspamd.preset [new file with mode: 0644]
conf/rspamd.systemd.conf
debian/rules
rspamd.socket [deleted file]

index 0813677e7a47e562bde056de9e9ad770895cb320..7e62f5c23c89478f61e71929795507146b6c67aa 100644 (file)
@@ -1290,7 +1290,6 @@ ENDFOREACH(LUA_CONF)
 # systemd unit
 IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON")
        INSTALL(FILES "rspamd.service" DESTINATION ${SYSTEMDDIR})
-       INSTALL(FILES "rspamd.socket" DESTINATION ${SYSTEMDDIR})
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON")
 
 # Manual pages
index 0dc374cf2b3a1ce38eea4ce1868c8b8d058eae7a..cd4a413a64b10bfc7aae838b325e4f65cf79a7db 100644 (file)
@@ -53,6 +53,7 @@ Source2:        %{name}.logrotate
 %endif
 
 Source0:        https://rspamd.com/downloads/%{name}-%{version}.tar.xz
+Source3:       80-rspamd.preset
 
 %description
 Rspamd is a rapid, modular and lightweight spam filter. It is designed to work
@@ -99,6 +100,7 @@ lua.
 
 %install
 %{__make} install DESTDIR=%{buildroot} INSTALLDIRS=vendor
+%{__install} -p -D -m 0644 %{SOURCE3} %{buildroot}%{_presetdir}/80-rspamd.preset
 
 %if 0%{?el6}
 %{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
@@ -120,7 +122,6 @@ rm -rf %{buildroot}
 
 %if 0%{?suse_version}
 %service_add_pre %{name}.service
-%service_add_pre %{name}.socket
 %endif
 
 %post
@@ -128,11 +129,11 @@ rm -rf %{buildroot}
 %{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
 %if 0%{?suse_version}
 %service_add_post %{name}.service
-%service_add_post %{name}.socket
 %endif
 %if 0%{?fedora} || 0%{?el7}
-%systemd_post %{name}.service
-%systemd_post %{name}.socket
+#Macro is not used as we want to do this on upgrade
+#%systemd_post %{name}.service
+systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
 %endif
 %if 0%{?el6}
 /sbin/chkconfig --add %{name}
@@ -141,11 +142,9 @@ rm -rf %{buildroot}
 %preun
 %if 0%{?suse_version}
 %service_del_preun %{name}.service
-%service_del_preun %{name}.socket
 %endif
 %if 0%{?fedora} || 0%{?el7}
 %systemd_preun %{name}.service
-%systemd_preun %{name}.socket
 %endif
 %if 0%{?el6}
 if [ $1 = 0 ]; then
@@ -157,11 +156,9 @@ fi
 %postun
 %if 0%{?suse_version}
 %service_del_postun %{name}.service
-%service_del_postun %{name}.socket
 %endif
 %if 0%{?fedora} || 0%{?el7}
 %systemd_postun_with_restart %{name}.service
-%systemd_postun %{name}.socket
 %endif
 %if 0%{?el6}
 if [ $1 -ge 1 ]; then
@@ -174,7 +171,7 @@ fi
 %defattr(-,root,root,-)
 %if 0%{?suse_version} || 0%{?fedora} || 0%{?el7}
 %{_unitdir}/%{name}.service
-%{_unitdir}/%{name}.socket
+%{_presetdir}/80-rspamd.preset
 %endif
 %if 0%{?el6}
 %{_initrddir}/%{name}
diff --git a/centos/sources/80-rspamd.preset b/centos/sources/80-rspamd.preset
new file mode 100644 (file)
index 0000000..0fcf159
--- /dev/null
@@ -0,0 +1 @@
+enable rspamd.service
index 8fed5108b443d7c33e9977de15240f0d2b1a7fd6..92e56180eb6bbaddd7f44604a3af60b6c82155c3 100644 (file)
@@ -32,14 +32,14 @@ logging {
 }
 
 worker {
-    bind_socket = "systemd:0";
+    bind_socket = "*:11333";
     .include "$CONFDIR/worker-normal.inc"
     .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-normal.inc"
     .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc"
 }
 
 worker {
-    bind_socket = "systemd:1";
+    bind_socket = "localhost:11334";
     .include "$CONFDIR/worker-controller.inc"
     .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-controller.inc"
     .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc"
index 1bb93c663792f8e19d9bfbb60f4f2d70d754df86..d9aeb5a8399e5b20b139676e4bd74d98b4bf075e 100755 (executable)
@@ -43,12 +43,3 @@ override_dh_auto_clean:
 override_dh_fixperms:
        dh_fixperms
        chmod 750 $(CURDIR)/debian/rspamd/var/lib/rspamd
-
-override_dh_systemd_enable:
-       dh_systemd_enable rspamd.socket
-
-override_dh_systemd_start:
-       dh_systemd_start --restart-after-upgrade --no-start
-
-override_dh_installinit:
-       dh_installinit -n
diff --git a/rspamd.socket b/rspamd.socket
deleted file mode 100644 (file)
index e28becc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=rapid spam filtering system
-
-[Socket]
-ListenStream=11333
-ListenStream=[::1]:11334
-BindIPv6Only=both
-
-[Install]
-WantedBy=sockets.target