diff --git a/README.md b/README.md index a09d78d..0efc0d3 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ make test | Runs the application unit tests 1. Copy the compiled binary (bin/clammit), either into your project repository, or to an installation area. 2. Edit the configuration file as appropriate. -3. Configure your auto-start mechanism, be it God or init.d +3. Configure your auto-start mechanism, be it God or init.d. An example systemd unig is provided. 4. Configure the upstream webserver to forward appropriate POST requests to clammit. ## API diff --git a/clammit.service.example b/clammit.service.example new file mode 100644 index 0000000..85691ba --- /dev/null +++ b/clammit.service.example @@ -0,0 +1,33 @@ +[Unit] +Description=Clammit - ClamAV HTTP filter +After=network.target syslog.target + +[Install] +WantedBy=multi-user.target + +[Service] +User=clammit +Group=clammit +Type=simple + +ExecStart=/usr/local/sbin/clammit -config=/etc/clammit.conf +KillSignal=SIGTERM +KillMode=control-group + +StandardOutput=journal +StandardError=journal +SyslogIdentifier=clammit + +# Wait few secs when restarting after a failure +RestartSec=2 +# Always-on +Restart=always + +PrivateTmp=true +PrivateDevices=true + +ProtectSystem=full + +ReadOnlyDirectories=/ +ReadWriteDirectories=/var/log/clammit +ReadWriteDirectories=/var/run/clammit