diff options
Diffstat (limited to 'app-antivirus/clamav/files/clamav-milter.initd')
-rwxr-xr-x | app-antivirus/clamav/files/clamav-milter.initd | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app-antivirus/clamav/files/clamav-milter.initd b/app-antivirus/clamav/files/clamav-milter.initd new file mode 100755 index 000000000000..049d908155d3 --- /dev/null +++ b/app-antivirus/clamav/files/clamav-milter.initd @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +# Note: the "Foreground" option in clamav-milter.conf MUST +# be set to "no". +command="/usr/sbin/clamav-milter" + +# For now, must be manually synchronized with the PidFile +# variable in clamav-milter.conf. +# +# https://bugzilla.clamav.net/show_bug.cgi?id=12595 +# +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + # The milter can successfully launch without clamd, but it's not a + # great user experience to have the milter start accepting requests + # that it can't process. The "use" dependency below will start clamd + # before clamav-milter, so long as clamd is also present this runlevel. + use clamd +} + +start_pre() { + # This exists to support the (disabled) default MilterSocket setting + # within clamav-milter.conf. The "clamav" user and group agree with + # the (disabled) default "User" and "MilterSocketGroup" settings. + # + # Creating this directory is harmless even when a local socket is + # not used. In fact, the clamd service that we depend on should + # create it as well, to hold its own local socket (if enabled). + checkpath --directory \ + --mode 0755 \ + --owner clamav:clamav \ + "/run/clamav" +} |