+ Post New Thread
Results 1 to 12 of 12
*nix Thread, Dansguardian 2.10.0.3 and Ubuntu 9.04 in Technical; Hello I'm trying to manually compile dansguardian 2.10.0.3 on ubuntu server 9.04 (this version of DG supports blanket block of ...
  1. #1

    Join Date
    Mar 2007
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Dansguardian 2.10.0.3 and Ubuntu 9.04

    Hello
    I'm trying to manually compile dansguardian 2.10.0.3 on ubuntu server 9.04 (this version of DG supports blanket block of https by ip address which is what im after not the version on the repo of 2.9.9.7)
    I cant get it to work .....ive done ./configure - make and make install and it completes with no errors.
    What happens next ?
    Do i need to specify additional parameters to the ./configure command line ?
    How do i get DG to start ? I assume that i need to link some files with the init.d folder ..dunno
    I'm at a loss where to look next cant seem to find any information anywhere
    I've always used apt-get to install pre compiled packages in the past
    Cheers

  2. #2

    Join Date
    Oct 2008
    Location
    Hedge End, Southampton
    Posts
    56
    Thank Post
    1
    Thanked 10 Times in 10 Posts
    Rep Power
    13
    Look for the dansguardian binary (whereis dansguardian), likely in /usr/local/dansguardian/ if you didn't chose anywhere different at the configure step.

    DG may have installed init scripts, or have sample files included, is there anything in the source tarball you grabbed?

  3. #3

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    There's a system-v init script included for you:

    Code:
    $ sudo cp /usr/local/share/dansguardian/scripts/systemv-init /etc/init.d/dansguardian
    $ sudo /etc/init.d/dansguardian start
    You'll also find a log-rotate plugin in there. Of course, make sure you've configured it first, as instructed in the INSTALL file.

  4. #4

    Join Date
    Mar 2007
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hello there
    Thanks for the pointers in the right direction

    after running /etc/init.d/dansguardian i get this error "-bash: /etc/init.d/dansguardian: Permission denied" so i changed the permissions the the dansguardian file to excecute run the command again now i get this error "/etc/init.d/dansguardian: 27: Syntax error: "(" unexpected"

    any ideas ?

    here is my DG start up script (etc/init.d/dansguardian ), ive not modified anything in the ./configure except --enable-ntlm=yes and the package is dansguardian-2.10.0.3.tar.gz from the dansguardian web site.


    #!/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: /usr/local/var/run/dansguardian.pid
    # config: /usr/local/etc/dansguardian/dansguardian.conf

    ### BEGIN INIT INFO
    # Provides: dansguardian
    # Required-Start: squid
    # Should-Start:
    # Required-Stop: squid
    # Should-Stop:
    # Default-Start: 3 5
    # Default-Stop: 0 1 2 6
    # Short-Description: Dansguardian web content filter
    # Description: Dansguardian web content filter
    ### END INIT INFO

    # 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 /usr/local/sbin/dansguardian ] &&
    [ -f /usr/local/etc/dansguardian/dansguardian.conf ]; then
    echo -n "Starting dansguardian: "
    if /usr/local/sbin/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 /usr/local/var/run/dansguardian.pid ] ; then
    WAITPID=`cat /usr/local/var/run/dansguardian.pid`
    fi
    if /usr/local/sbin/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 /usr/local/var/run/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 /usr/local/sbin/dansguardian ]; then
    /usr/local/sbin/dansguardian -s
    fi
    ;;

    *)

    echo "Usage: $0 {start|stop|restart|status}" >&2
    ;;
    esac

    exit 0


    Thanks in advance

    karl

  5. #5

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    I'm not a sh master, but I don't think you need the word 'function' on line 22.

  6. #6

    Join Date
    Mar 2007
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hello powdarrmonkey

    i rem out out function wait_for_pid() on line 22

    now i got a different error !!!!

    root@ubuntu904:/apps/dansguardian-2.10.0.3# /etc/init.d/dansguardian start
    [: 52: Illegal number: start

    Cheers

    Karl

  7. #7

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    No don't get rid of the whole line, just remove the 'function' keyword.

  8. #8

    Join Date
    Mar 2007
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hello again

    After just removing function from the line i now get this error......!!!

    root@ubuntu904:/apps/dansguardian-2.10.0.3# /etc/init.d/dansguardian start Starting dansguardian: -e -e [ -e FAILED-e ]

    any more ideas or suggestions

    Cheers

    Karl

  9. #9

    Join Date
    Oct 2008
    Location
    Hedge End, Southampton
    Posts
    56
    Thank Post
    1
    Thanked 10 Times in 10 Posts
    Rep Power
    13
    I've tried the script and it runs fine for me - have you tried:
    Code:
    sh /etc/init.d/dansguardian start
    ?

  10. #10

    Join Date
    Mar 2007
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    startup script woes!!

    Hello
    after trying sh /etc/init.d/dansguardian start this appears

    root@ubuntu904:/apps/dansguardian-2.10.0.3# sh /etc/init.d/dansguardian start
    Starting dansguardian: -e -e [ -e OK-e ]

    #to see whats what

    root@ubuntu904:/apps/dansguardian-2.10.0.3# dansguardian -s
    Parent DansGuardian pid:14798
    root@ubuntu904:/apps/dansguardian-2.10.0.3# dansguardian -v
    DansGuardian 2.10.0.3

    Built with: '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--enable-ntlm=yes'
    root@ubuntu904:/apps/dansguardian-2.10.0.3#

    dansguardian is working

    reboot machine dansguardian not starting up automatically

    root@ubuntu904:~# dansguardian -s
    No DansGuardian process found.
    root@ubuntu904:~#

    not a clue about this ...whats the -e [ -e OK-e] after running startup ? never seen that before when starting programs

    Cheers

  11. #11

    Join Date
    Oct 2008
    Location
    Hedge End, Southampton
    Posts
    56
    Thank Post
    1
    Thanked 10 Times in 10 Posts
    Rep Power
    13
    The extra output you're seeing is probably down to this part of the code:
    Code:
    echo -e "\\033[60G\c"
    echo -e "[ \\033[1;32m\c"
    echo -e "OK\c"
    echo -e "\\033[0;39m\c"
    echo " ]"
    It's printing the '-e' which should be read as an argument to the echo command. This might be related to why your shell can't run the script, you can find which shell you're using by:
    Code:
    echo $SHELL
    As the script works when executed manually with sh (bash [it's a bash script]) it is correct and working, to make it execute on boot you'll have to generate init scripts to bring the service up, for that you use update-rc.d.

    Code:
    update-rc.d dansguardian defaults

  12. #12

    Join Date
    Mar 2007
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    log rotation ?

    Hello there

    thanks to james_yale and powdarrmonkey

    i now have my dansguardian up and running and booting on startup.....phew!!!

    before i waste another couple of days of my life ........ can you give me some clues as how to set up log rotation for dansguardian access logs please

    Cheers and thanks again

SHARE:
+ Post New Thread

Similar Threads

  1. Dansguardian 2.10 on Ubuntu 8.04
    By ianniow in forum *nix
    Replies: 3
    Last Post: 3rd June 2009, 11:46 AM
  2. Dansguardian Startup
    By ahuxham in forum *nix
    Replies: 9
    Last Post: 24th June 2008, 01:48 PM
  3. Replies: 9
    Last Post: 25th March 2008, 06:13 PM
  4. Dansguardian
    By DMcCoy in forum *nix
    Replies: 10
    Last Post: 25th January 2008, 01:17 PM
  5. dansguardian
    By callumtuckey in forum How do you do....it?
    Replies: 3
    Last Post: 21st May 2007, 08:43 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •