Download this file
| 1 | # đŸ¤– clamd on TCP, for the console. Open only behind a passed self-test. |
| 2 | # |
| 3 | # DefaultDependencies=no is load-bearing. A socket unit is ordered before |
| 4 | # sockets.target by default, sockets.target before basic.target, and every |
| 5 | # service (the self-test included) after basic.target. A socket that must also |
| 6 | # come AFTER the self-test closes that loop, and systemd breaks an ordering |
| 7 | # cycle by dropping a job, which could leave this port shut after a reboot. |
| 8 | # So it opts out, restores what it still needs, and is started by |
| 9 | # multi-user.target and by clamd's Wants=, never by sockets.target. |
| 10 | [Unit] |
| 11 | Description=clamd on TCP, open only behind a passed self-test |
| 12 | DefaultDependencies=no |
| 13 | After=sysinit.target |
| 14 | Requires=scanner-selftest.service |
| 15 | After=scanner-selftest.service |
| 16 | BindsTo=scanner-selftest.service |
| 17 | Conflicts=shutdown.target |
| 18 | Before=shutdown.target |
| 19 | |
| 20 | [Socket] |
| 21 | ListenStream=@PRIVATE_IP@:3310 |
| 22 | # Binds even if the private address is not up yet at boot. |
| 23 | FreeBind=yes |
| 24 | |
| 25 | [Install] |
| 26 | WantedBy=multi-user.target |
| 27 | |