On Tue, 12 Feb 2019 at 22:30, Michael Orlitzky <[email protected]> wrote:
>
> On 2/12/19 12:30 PM, Curtis Maurand wrote:
> > sudo /usr/sbin/amavisd-new reload
>
> The systemd service should be able to do this for you, e.g.
>   ExecReload=/usr/sbin/amavisd -c /etc/amavisd.conf reload
> if the "forking" service type is used.

Thanks Curtis and Michael. I have now implemented this. In Ubuntu
18.04 the systemd service is just calling /etc/init.d/amavis (SysV) so
this is what needed changing by adding the reload option. I attach a
patch for this file (/etc/init.d/amavis), after applying it do
'systemctl daemon-reload' so that 'systemctl reload-or-restart amavis'
will do a warm reload of amavis instead of the full shutdown/start.

If it is working the first log entry for the action will show '(warm)':
2019-02-13 10:10:42 streamingbats amavis[30715]: starting. (warm)
/usr/sbin/amavisd-new at streamingbats.co.uk amavisd-new-2.11.0
(20160426), Unicode aware, LC_ALL="C", LANG="en_GB.UTF-8"

>From Patrick's reply to another question I take it that reloading
amavis *is* required after updating any SA configs.
--- /tmp/amavis	2019-02-13 10:12:34.738692753 +0000
+++ /etc/init.d/amavis	2019-02-13 10:09:18.378072890 +0000
@@ -118,10 +118,11 @@
 		fi
 	fi
 	;;
-#  reload)
-#	echo "Reloading $DESC configuration files."
+  reload)
+	echo "Reloading $DESC configuration files."
+	$DAEMON reload || { echo "(failed)."; exit 1; }
 #	start-stop-daemon ${STOP} --signal 1
-# 	;;
+ 	;;
   restart|force-reload)
 	$0 stop
 	exec $0 start
@@ -139,7 +140,7 @@
   *)
 	N=/etc/init.d/amavis
 	#echo "Usage: $N {start|stop|restart|reload|force-reload|debug}" >&2
-	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	echo "Usage: $N {start|stop|reload|restart|force-reload|status|debug}" >&2
 	exit 1
 	;;
 esac

Reply via email to