× Installation and guides about a great free, plesk and cpanel alternative project

How to Fix ClamAV “Can’t Save PID” Error on CWP7

Περισσότερα
1 Εβδομάδα 6 Ημέρες πριν - 1 Εβδομάδα 6 Ημέρες πριν #350 από infogate
After a CWP7, AlmaLinux, systemd, or ClamAV update, the ClamAV daemon may fail to start.When checking its status, you may see:
× clamd.service - clamd scanner daemon
Active: failed (Result: exit-code)
ExecStart=/usr/sbin/clamd -c /etc/clamd.d/amavisd.conf --foreground=yes
The system log reveals the actual error:
ERROR: Can't save PID to file /run/clamd.amavisd/clamd.pid:
No such file or directory
What causes the problem? The directory
/run/clamd.amavisd
is missing.The
/run
filesystem contains temporary runtime data and is recreated after every server reboot. If the ClamAV systemd service does not recreate its runtime directory,
clamd
cannot create its PID file and exits immediately with status code 2.Permanent solution Connect to your CWP7 server through SSH as
root
and run the following complete block:
mkdir -p /etc/systemd/system/clamd.service.dcat > /etc/systemd/system/clamd.service.d/runtime-directory.conf <<'EOF'
[Service]
RuntimeDirectory=clamd.amavisd
RuntimeDirectoryMode=0755
EOFsystemctl daemon-reload
systemctl reset-failed clamd
systemctl restart clamd
This creates a systemd override that automatically creates
/run/clamd.amavisd
whenever the ClamAV service starts.Verify the repair Run:
echo "=== CLAMD STATUS ==="
systemctl status clamd --no-pager -lecho
echo "=== RUNTIME DIRECTORY ==="
ls -ld /run/clamd.amavisd
ls -l /run/clamd.amavisdecho
echo "=== RECENT CLAMD LOG ==="
journalctl -u clamd -n 50 --no-pager
If the repair was successful, the service should show:
Active: active (running)
Check the configured PID file Confirm which PID file is configured for the Amavis ClamAV instance:
grep -nE '^[[:space:]]*PidFile' /etc/clamd.d/amavisd.conf
The expected result is normally:
PidFile /run/clamd.amavisd/clamd.pid
Why not create the missing directory manually? The following command may restore ClamAV temporarily:
mkdir -p /run/clamd.amavisd
However, the directory may disappear after the next reboot because
/run
contains temporary runtime data.The systemd override is the permanent solution because it recreates the required directory automatically whenever ClamAV starts.Important notes
iDo not delete
/var/lib/clamav
as the first troubleshooting step.
/iDo not reinstall ClamAV before identifying the actual startup error.
iDo not repeatedly restart the service without checking its journal.
/iThis error does not mean that the ClamAV virus databases are corrupted.
iThis solution applies when
clamd.service
uses
/etc/clamd.d/amavisd.conf
.
/iAlways verify the PID path before applying the fix to a differently configured server.
Useful diagnostic commands Check the ClamAV service:
systemctl status clamd --no-pager -l
Check the latest service log:
journalctl -u clamd -n 100 --no-pager
Check all failed systemd services:
systemctl --failed --no-pager
If the journal reports that
/run/clamd.amavisd/clamd.pid
cannot be created because the directory does not exist, the systemd override above should resolve the problem permanently.


The best possible way to start your online marketing : fspirits.com/go/leadsleap-home
Explode Your Web Site Traffice: fspirits.com/go/sparktraffic
Start your affiliate journey here: fspirits.com/go/olsp-academy
Best Solution To Create Videos: fspirits.com/go/create-studio-pro
Best Solution To Create Graphics: fspirits.com/go/clickdesigns
Smart Chat Automation: fspirits.com/go/chatterpal
Multi-Purpose Video Maker: fspirits.com/go/avatar-builder
Multi-Purpose Video Creator: fspirits.com/go/video-creator
AI Human Spokesperson Videos: fspirits.com/go/humanpal

Last edit: 1 Εβδομάδα 6 Ημέρες πριν by infogate.

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.073 δευτερόλεπτα
Powered by Kunena Φόρουμ
Banner Image