This document outlines the architecture, service management, and packaging strategy for GriffonAV on Linux. Since an antivirus requires high privileges and constant background monitoring, we will focus on a Systemd-managed Daemon approach.


1. System Architecture Overview

The GriffonAV ecosystem consists of four main components interacting via a Unix Domain Socket.


2. Connecting the Components (The Logic)

To ensure the app "just works," the client must be able to wake the daemon.

The Socket Activation Method (Recommended)

Instead of the CLI manually spawning a process (which can lead to "zombie" processes), Linux uses Socket Activation.

  1. Systemd listens on /run/griffon.sock.
  2. When you run griffon-cli scan, it tries to write to that socket.
  3. Systemd intercepts this, realizes the daemon isn't running, starts griffond, and hands off the connection.

The Config Hierarchy

To support both "Default" and "Custom" plugins, your Rust code should look in these locations in order:

  1. System: /usr/lib/griffon/plugins/ (Read-only, default plugins).
  2. User: $HOME/.config/griffon/plugins/ (User-added plugins).