Skip to content

Commit

Permalink
dansguardian: Added systemd service files
Browse files Browse the repository at this point in the history
- Changed pidfile path
- Changed default user when not using clamav to dansguardian instead of nobody
  • Loading branch information
Ratler committed Jul 31, 2012
1 parent 39c47e0 commit 694b4c5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
13 changes: 8 additions & 5 deletions web/dansguardian/BUILD
Expand Up @@ -8,14 +8,15 @@
--enable-lfs \
--enable-orig-ip \
--with-logdir=/var/log/dansguardian \
--with-piddir=/var/run" &&
--with-piddir=/var/run/dansguardian" &&

if in_depends $MODULE clamav; then
DGUSER="clamav:clamav"
OPTS+=" --with-proxyuser=clamav --with-proxygroup=clamav"
else
DGUSER="nobody:nogroup"
OPTS+=" --with-proxyuser=nobody --with-proxygroup=nogroup"
add_priv_user dansguardian:dansguardian
DGUSER="dansguardian:dansguardian"
OPTS+=" --with-proxyuser=dansguardian --with-proxygroup=dansguardian"
fi &&

default_build &&
Expand All @@ -26,8 +27,10 @@
sedit "s;^#clamdudsfile.*;clamdudsfile = '/tmp/clamd';" /etc/dansguardian/contentscanners/clamdscan.conf
fi &&

if [ ! -d /var/log/dansguardian ]; then
mkdir -p /var/log/dansguardian
[ -d /var/log/dansguardian ] || mkdir -p /var/log/dansguardian &&

if module_installed systemd; then
mkdir -p /run/dansguardian
fi &&

devoke_installwatch &&
Expand Down
11 changes: 11 additions & 0 deletions web/dansguardian/systemd.d/dansguardian.service
@@ -0,0 +1,11 @@
[Unit]
Description=DansGuardian Content Filter
After=network.target squid.service

[Service]
Type=forking
PIDFile=/run/dansguardian/dansguardian.pid
ExecStart=/usr/sbin/dansguardian

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions web/dansguardian/tmpfiles.d/dansguardian.conf
@@ -0,0 +1 @@
d /run/dansguardian 0755 root root -

0 comments on commit 694b4c5

Please sign in to comment.