Spaces:
Runtime error
Runtime error
pengdaqian
commited on
Commit
•
e0eb42c
1
Parent(s):
b10f399
change
Browse files
init
CHANGED
@@ -48,6 +48,42 @@ else
|
|
48 |
--daemon \
|
49 |
--foreground \
|
50 |
--stdout \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/ $ cat /init
|
52 |
#!/sbin/tini /bin/sh
|
53 |
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
48 |
--daemon \
|
49 |
--foreground \
|
50 |
--stdout \
|
51 |
+
--user="clamav" \
|
52 |
+
&
|
53 |
+
fi
|
54 |
+
|
55 |
+
if [ "${CLAMAV_NO_CLAMD:-false}" != "true" ]; then
|
56 |
+
echo "Starting ClamAV"
|
57 |
+
if [ -S "/run/clamav/clamd.sock" ]; then
|
58 |
+
unlink "/run/clamav/clamd.sock"
|
59 |
+
fi
|
60 |
+
if [ -S "/tmp/clamd.sock" ]; then
|
61 |
+
unlink "/tmp/clamd.sock"
|
62 |
+
fi
|
63 |
+
clamd --foreground &
|
64 |
+
while [ ! -S "/run/clamav/clamd.sock" ] && [ ! -S "/tmp/clamd.sock" ]; do
|
65 |
+
if [ "${_timeout:=0}" -gt "${CLAMD_STARTUP_TIMEOUT:=1800}" ]; then
|
66 |
+
echo
|
67 |
+
echo "Failed to start clamd"
|
68 |
+
exit 1
|
69 |
+
fi
|
70 |
+
printf "\r%s" "Socket for clamd not found yet, retrying (${_timeout}/${CLAMD_STARTUP_TIMEOUT}) ..."
|
71 |
+
sleep 1
|
72 |
+
_timeout="$((_timeout + 1))"
|
73 |
+
done
|
74 |
+
echo "socket found, clamd started."
|
75 |
+
fi
|
76 |
+
|
77 |
+
if [ "${CLAMAV_NO_MILTERD:-true}" != "true" ]; then
|
78 |
+
echo "Starting clamav milterd"
|
79 |
+
clamav-milter &
|
80 |
+
fi
|
81 |
+
|
82 |
+
# Wait forever (or until canceled)
|
83 |
+
exec tail -f "/dev/null"
|
84 |
+
fi
|
85 |
+
|
86 |
+
exit 0
|
87 |
/ $ cat /init
|
88 |
#!/sbin/tini /bin/sh
|
89 |
# SPDX-License-Identifier: GPL-2.0-or-later
|