[linux] Squid

JA SAM dodo na stapro.sk
Pátek Červenec 27 09:17:42 CEST 2001


Subor
/etc/rc.d/init.d/squid
by mal obsahovat uplne na zaciatku (zakomentovane) nastavenie
# chkconfig: - 90 25
alebo
# chkconfig: 2345 90 25
alebo nieco podobne... (pozri si to v ostatnych suboroch v tvojej
distribucii)
To hovori o urovnich, v ktorych ma byt spusteny 2,3,4,5
a o poradi spustania 90 a zhadzovania 25...

nespusta sa to, co je v /etc/rc.d/init.d, ale to, co je v
/etc/rc.d/rc[1,2,3,4,5].d - su to linky na subory v init.d, ale
su doplnene o S(start)a poradove cilo starovania (najmensie cislo sa
startuje najskor...) a K(kill?) a poradove cislo zhadzovania (poradie
obdobne...)
podla prave zvolenej urovne

pomoze ti man chkconfig ...

Dodo.

PS: subor by mal obsahovat pred tymi riadkami, co si napisal nieco take...
#!/bin/bash
# squid		pokec... (nepovinne)
# chkconfig: - 90 25
# description: popis... (nepovinne)
a az potom:

> # pidfile: /var/run/squid.pid
> # config: /etc/squid/squid.conf
>
> PATH=/usr/bin:/sbin:/bin:/usr/sbin
> export PATH
>
> # Source function library.
> . /etc/rc.d/init.d/functions
> # Check that networking is up.
> [ ${NETWORKING} = "no" ] && exit 0
>
> # check if the squid conf file is present
> [ -f /etc/squid/squid.conf ] || exit 0
>
> # determine the name of the squid binary
> [ -f /usr/sbin/squid ] && SQUID=squid
> [ -z "$SQUID" ] && exit 0
>
> # determine which one is the cache_swap directory
> CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \
>         grep cache_dir | sed -e 's/cache_dir//' | \
>         cut -d ' ' -f 2`
> [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid
>
> # default squid options
> # -D disables initial dns checks. If you most likely will not to have an
> #    internet connection when you start squid, uncomment this
> SQUID_OPTS="-D"
>
> case "$1" in
> start)
>     echo -n "Starting $SQUID: "
>     for adir in $CACHE_SWAP; do
>         if [ ! -d $adir/00 ]; then
>              echo -n "init_cache_dir $adir... "
>              $SQUID -z -F 2>/dev/null
>         fi
>     done
>     $SQUID $SQUID_OPTS &
>     echo $SQUID
>     touch /var/lock/subsys/$SQUID
>     ;;
>
> stop)
>     echo -n "Stopping $SQUID: "
>     $SQUID -k shutdown &
>     rm -f /var/lock/subsys/$SQUID
>     while : ; do
>         [ -f /var/run/squid.pid ] || break
>         sleep 2 && echo -n "."
>     done
>     echo "done"
>     ;;
>
> restart)
>     $SQUID $SQUID_OPTS -k reconfigure
>     exit $?
>     ;;
>
> status)
>     status $SQUID
>     $SQUID -k check
>     exit $?
>     ;;
>
> probe)
>     exit 0;
>     ;;
>
> *)
>     echo "Usage: $0 {start|stop|status|restart}"
>     exit 1
> esac
>
>
> exit 0
>
>
>
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> _______________________________________________
> http://lists.linux.sk/listinfo/linux
> http://search.lists.linux.sk





Další informace o konferenci linux