[Lunar-commits] <moonbase-other> dansguardian: Added systemd service files

Stefan Wold ratler at lunar-linux.org
Tue Jul 31 19:54:32 CEST 2012


commit 694b4c553f5c43607d387deee6931f45c71513ad
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Tue, 31 Jul 2012 10:54:32 -0700
URL: https://github.com/lunar-linux/moonbase-other/commit/694b4c553f5c43607d387deee6931f45c71513ad

dansguardian: Added systemd service files

- Changed pidfile path
- Changed default user when not using clamav to dansguardian instead of nobody
---
  web/dansguardian/BUILD                                       +8/-5     
  web/dansguardian/systemd.d/dansguardian.service              +11/-0    
  web/dansguardian/tmpfiles.d/dansguardian.conf                +1/-0     
  3 files changed, 20 insertions (+), 5 deletions (-)

--- a/web/dansguardian/BUILD
+++ b/web/dansguardian/BUILD
@@ -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 &&
@@ -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 &&
--- /dev/null
+++ b/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
--- /dev/null
+++ b/web/dansguardian/tmpfiles.d/dansguardian.conf
@@ -0,0 +1 @@
+d /run/dansguardian 0755 root root -




More information about the Lunar-commits mailing list