diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rwxr-xr-x | sbin/init.d/network | 2 | ||||
-rwxr-xr-x | sbin/init.d/squid | 46 | ||||
-rwxr-xr-x | sbin/init.d/sysprofiles | 2 |
4 files changed, 54 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2003/10/26 : 0.3.25 +- network : now supports a "vrrp" option which is only used by external scripts. +- squid : fix squidguard handling +- sysprofiles : close stdin during services startup to prevent them from reading + the services list as their input 2003/10/02 : 0.3.24 - functions : 'do_restart' now does its best to kill frozen processes and to bypass defuncts. Its goal is now clearly to get the service up at any cost. diff --git a/sbin/init.d/network b/sbin/init.d/network index cc95505..7e6714b 100755 --- a/sbin/init.d/network +++ b/sbin/init.d/network @@ -14,6 +14,7 @@ # [no] multicast # shutdown # ip route <ip/mask> <gw> [ip args...] +# vrrp ... (ignored by this script) # we want ALL instances to stop and restart at once if [ "$1" = "restart" ]; then @@ -37,6 +38,7 @@ option mtu standard_option option arp boolean_option 1 option multicast boolean_option 1 option shutdown boolean_option +option vrrp multiple_option SVC_VARS="addr_list route_list addr_idx route_idx" diff --git a/sbin/init.d/squid b/sbin/init.d/squid index cdb32f1..6b6f328 100755 --- a/sbin/init.d/squid +++ b/sbin/init.d/squid @@ -13,7 +13,53 @@ option waitrebuild boolean_option 0 option reuseaddr boolean_option 1 option doublecheck boolean_option 0 option vhostaccel boolean_option 0 + option bin reserved_option /opt/sbin/squid +option gbin reserved_option /opt/bin/squidGuard +option pidfile reserved_option /var/log/squid/squid.pid +option cmdline reserved_option '$bin -D' + +function fct_pre_start { + + valueof $opt_config cache_log >/dev/null 2>&1 + [ -z "$REPLY" ] && REPLY=/var/log/squid/cache.log + [ ! -d ${REPLY%/*} ] && mkdir -p ${REPLY%/*} \ + && chown -R squid:squid ${REPLY%/*} + + valueof $opt_config cache_dir >/dev/null 2>&1 + set -- $REPLY ; REPLY=$2 + [ -z "$REPLY" ] && REPLY=/var/opt/squid/cache + [ ! -d $REPLY ] && mkdir -p $REPLY \ + && chown -R squid:squid $REPLY \ + && $bin -z + + valueof $opt_config redirect_program >/dev/null 2>&1 + set -- $REPLY + if [ -n "$1" -a -z "${1//*squidGuard*/}" ] ; then + echo -n "# Preparing squidGuard ... " + [ ! -e /var/log/squidGuard ] && ln -s squid /var/log/squidGuard + if [ ! -d /var/cache/squidGuard ] ; then + mkdir -p /var/cache/squidGuard + do_update_squidguard + fi + echo "done." + fi +} + +function do_update_squidguard { + for file in $(find /opt/squidGuard/db/ \ + -name "*.tgz" -o -name "*.tar.gz") ; do + tar zxf $file -C /var/cache/squidGuard + done + chown -R squid:squid /var/cache/squidGuard + sudo -u squid $gbin -C all </dev/null + find /var/cache/squidGuard/ -name "*.diff" | while read ; do + cat $REPLY >> ${REPLY%%[.0-9]*.diff}.diff + done + sudo -u squid $gbin -u </dev/null + find /var/cache/squidGuard/ -name "*.diff" | xargs rm -f + find /var/cache/squidGuard/ -name "*.db"|sed 's/\.db$//'|xargs rm -f +} function fct_end_section { local chroot diff --git a/sbin/init.d/sysprofiles b/sbin/init.d/sysprofiles index 279215a..7ecd797 100755 --- a/sbin/init.d/sysprofiles +++ b/sbin/init.d/sysprofiles @@ -1,3 +1,3 @@ #!/bin/bash cfgfile=$1 -. /sbin/init.d/functions -f $cfgfile --list_sections|(last=;while read svc rest; do if [ "$svc" != "$last" ]; then /sbin/init.d/$svc -f $cfgfile --auto start; fi; last=$svc; done) +. /sbin/init.d/functions -f $cfgfile --list_sections|(last=;while read svc rest; do if [ "$svc" != "$last" ]; then /sbin/init.d/$svc -f $cfgfile --auto start </dev/null; fi; last=$svc; done) |