summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-antivirus/clamav/files/clamd.initd')
-rw-r--r--app-antivirus/clamav/files/clamd.initd33
1 files changed, 33 insertions, 0 deletions
diff --git a/app-antivirus/clamav/files/clamd.initd b/app-antivirus/clamav/files/clamd.initd
new file mode 100644
index 000000000000..efc01efc41b0
--- /dev/null
+++ b/app-antivirus/clamav/files/clamd.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+
+# Note: the "Foreground" option in clamd.conf must be set to "no"
+command="/usr/sbin/clamd"
+extra_started_commands="reload"
+
+# For now, must be manually synchronized with the PidFile variable
+# in clamd.conf.
+#
+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
+#
+pidfile="/run/${RC_SVCNAME}.pid"
+
+start_pre() {
+ # This exists to support the (disabled) default LocalSocket setting
+ # within clamd.conf. The "clamav" user and group agree with the
+ # (disabled) default "User" and "LocalSocketGroup" settings in
+ # clamd.conf. And everything here agrees with the
+ # clamav-daemon.socket systemd service.
+ #
+ # Creating this directory is harmless even when a local socket is
+ # not used.
+ checkpath --directory \
+ --mode 0755 \
+ --owner clamav:clamav \
+ "/run/clamav"
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ "/usr/bin/clamdscan" --reload
+ eend $?
+}