]> git.pld-linux.org Git - packages/dansguardian.git/commitdiff
- new
authormatowy <matowy@pld-linux.org>
Tue, 22 Feb 2005 22:05:38 +0000 (22:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dansguardian.httpd -> 1.1
    dansguardian.init -> 1.1

dansguardian.httpd [new file with mode: 0644]
dansguardian.init [new file with mode: 0755]

diff --git a/dansguardian.httpd b/dansguardian.httpd
new file mode 100644 (file)
index 0000000..e7ababd
--- /dev/null
@@ -0,0 +1,9 @@
+ScriptAlias /dansguardian/ %{_localstatedir}/www/dansguardian/
+
+<Directory %{_localstatedir}/www/dansguardian/>
+        DirectoryIndex dansguardian.pl
+        Options ExecCGI
+        order deny,allow
+        deny from all
+        allow from 127.0.0.1
+</Directory>
diff --git a/dansguardian.init b/dansguardian.init
new file mode 100755 (executable)
index 0000000..9990e08
--- /dev/null
@@ -0,0 +1,116 @@
+#!/bin/sh
+#
+# Startup script for dansguardian
+#
+# chkconfig: 35 92 8
+# description: A web content filtering plugin for web \
+#              proxies, developed to filter using lists of \
+#              banned phrases, MIME types, filename \
+#              extensions and PICS labelling.
+# processname: dansguardian
+# pidfile: /var/run/dansguardian.pid
+# config: /etc/dansguardian/dansguardian.conf
+
+CONFFILELOCATION=/etc/dansguardian/
+BINARYLOCATION=/usr/sbin/
+PIDDIR=/var/run/
+
+# File includes changes by Thomas Jarosch
+function wait_for_pid()
+{
+    local PID=$1
+    local RET=0
+    
+    if [ $PID -eq 0 ] ; then
+        return $RET
+    fi
+    
+    # give 60 secs then KILL
+    local COUNTDOWN=60
+
+    while [ -d /proc/${PID} ] && [ $COUNTDOWN -gt 0 ] ; do
+        sleep 1
+        COUNTDOWN=$[$COUNTDOWN-1]
+    done
+
+    if [ -d /proc/${PID} ]; then
+        COMMAND=`ps h -o command ${PID}`
+        logger "dansguardian: timeout waiting for PID ${PID}: ${COMMAND}; sending SIGKILL"
+        kill -KILL $PID >/dev/null 2>&1
+        RET=1
+    fi
+    
+    return $RET
+}
+
+# See how we were called.
+
+case "$1" in
+start)
+        if [ -f ${BINARYLOCATION}dansguardian ] &&
+           [ -f ${CONFFILELOCATION}dansguardian.conf ]; then
+                echo -n "Starting dansguardian: "
+                if ${BINARYLOCATION}dansguardian 2> /dev/null; then
+                        echo -e "\\033[60G\c"
+                        echo -e "[ \\033[1;32m\c"
+                        echo -e "OK\c"
+                        echo -e "\\033[0;39m\c"
+                        echo " ]"
+                        [ -d /var/lock/subsys ] && touch /var/lock/subsys/dansguardian
+                else
+                        echo -e "\\033[60G\c"
+                        echo -e "[ \\033[1;31m\c"
+                        echo -e "FAILED\c"
+                        echo -e "\\033[0;39m\c"
+                        echo " ]"
+                fi
+        fi
+        ;;
+stop)
+        echo -n "Shutting down dansguardian: "
+        WAITPID=0
+        if [ -f ${PIDDIR}dansguardian.pid ] ; then
+            WAITPID=`cat ${PIDDIR}dansguardian.pid`
+        fi
+        if ${BINARYLOCATION}dansguardian -q 2> /dev/null; then
+                if wait_for_pid $WAITPID ; then
+                    echo -e "\\033[60G\c"
+                    echo -e "[ \\033[1;32m\c"
+                    echo -e "OK\c"
+                    echo -e "\\033[0;39m\c"
+                    echo " ]"
+                else
+                    echo -e "\\033[60G\c"
+                    echo -e "[ \\033[1;31m\c"
+                    echo -e "FAILED\c"
+                    echo -e "\\033[0;39m\c"
+                    echo " ]"
+                fi
+                /bin/rm -f ${PIDDIR}dansguardian.pid
+                /bin/rm -f /tmp/.dguardianipc
+                [ -d /var/lock/subsys ] && /bin/rm -f /var/lock/subsys/dansguardian
+        else
+                echo -e "\\033[60G\c"
+                echo -e "[ \\033[1;31m\c"
+                echo -e "FAILED\c"
+                echo -e "\\033[0;39m\c"
+                echo " ]"
+        fi
+        ;;
+restart)
+        $0 stop
+        $0 start
+        ;;
+status)
+        if [ -f ${BINARYLOCATION}dansguardian ]; then
+                ${BINARYLOCATION}dansguardian -s
+        fi
+        ;;
+        
+*)
+
+        echo "Usage: $0 {start|stop|restart|status}" >&2
+        ;;
+esac
+
+exit 0
This page took 0.150014 seconds and 4 git commands to generate.