Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ecsos:server
dansguardian
dansguardian.init-redhat
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File dansguardian.init-redhat of Package dansguardian
#!/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 ### 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 # Source function library. . /etc/rc.d/init.d/functions prog="dansguardian" DG_BINARY="/usr/sbin/dansguardian" # 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 } start() { if [ ! -f $DG_BINARY ]; then echo "Dansguardian binary $DG_BINARY is missing" 1>&2 exit 5 fi if [ ! -f /etc/dansguardian/dansguardian.conf ]; then echo "Dansguardian configuration file /etc/dansguardian/dansguardian.conf is missing" 1>&2 exit 6 fi echo -n "Starting $prog: " if $DG_BINARY 2> /dev/null; then echo_success [ -d /var/lock/subsys ] && touch /var/lock/subsys/dansguardian else echo_failure fi echo } stop() { echo -n "Shutting down $prog: " WAITPID=0 if [ -f /var/run/dansguardian.pid ] ; then WAITPID=`cat /var/run/dansguardian.pid` fi if $DG_BINARY -q 2> /dev/null; then if wait_for_pid $WAITPID ; then echo_success echo else echo_failure echo fi /bin/rm -f /var/run/dansguardian.pid /bin/rm -f /tmp/.dguardianipc [ -d /var/lock/subsys ] && /bin/rm -f /var/lock/subsys/dansguardian else echo_failure echo fi } reload() { echo -n "Reloading $prog: " killproc $DG_BINARY -HUP echo } restart() { stop start } condrestart() { [ -e /var/lock/subsys/dansguardian ] && restart || : } rhstatus() { status $DG_BINARY } probe() { return 0 } case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; condrestart) condrestart ;; status) rhstatus ;; probe) exit 0 ;; *) echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" exit 2 esac exit $?
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor