Skip to content

Commit

Permalink
doc: add sample systemd unit
Browse files Browse the repository at this point in the history
  • Loading branch information
vjt committed May 23, 2021
1 parent 3e366a4 commit 2d14304
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions clammit.service.example
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2d14304

Please sign in to comment.