- update to latest upstream 2.6.STABLE14
- resolves: #247064: Initscript Review
This commit is contained in:
parent
41ce9b724c
commit
80fa43085e
34
squid.init
34
squid.init
@ -36,16 +36,10 @@ SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100}
|
||||
# determine the name of the squid binary
|
||||
[ -f /usr/sbin/squid ] && SQUID=squid
|
||||
|
||||
if [ $1 -ne 'status' ]; then
|
||||
[ -z "$SQUID" ] && exit 1
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
# check if the squid conf file is present
|
||||
[ -f /etc/squid/squid.conf ] || exit 6
|
||||
else
|
||||
if [ $1 == 'status' ]; then
|
||||
[ -z "$SQUID" ] && exit 4
|
||||
else
|
||||
[ -z "$SQUID" ] && exit 1
|
||||
fi
|
||||
|
||||
prog="$SQUID"
|
||||
@ -57,12 +51,22 @@ CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \
|
||||
|
||||
RETVAL=0
|
||||
|
||||
probe() {
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
# check if the squid conf file is present
|
||||
[ -f /etc/squid/squid.conf ] || exit 6
|
||||
}
|
||||
|
||||
start() {
|
||||
probe
|
||||
|
||||
for adir in $CACHE_SWAP; do
|
||||
if [ ! -d $adir/00 ]; then
|
||||
echo -n "init_cache_dir $adir... "
|
||||
$SQUID -z -F -D >> /var/log/squid/squid.out 2>&1
|
||||
fi
|
||||
if [ ! -d $adir/00 ]; then
|
||||
echo -n "init_cache_dir $adir... "
|
||||
$SQUID -z -F -D >> /var/log/squid/squid.out 2>&1
|
||||
fi
|
||||
done
|
||||
echo -n $"Starting $prog: "
|
||||
$SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1
|
||||
@ -129,9 +133,6 @@ rhstatus() {
|
||||
status $SQUID && $SQUID -k check
|
||||
}
|
||||
|
||||
probe() {
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
@ -160,6 +161,7 @@ status)
|
||||
|
||||
probe)
|
||||
probe
|
||||
return 0
|
||||
;;
|
||||
|
||||
*)
|
||||
|
@ -190,8 +190,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir %{_datadir}/squid
|
||||
%config(noreplace) %{_datadir}/squid/errors
|
||||
%config(noreplace) /etc/squid/icons
|
||||
%config(noreplace) /etc/rc.d/init.d/squid
|
||||
%config(noreplace) /etc/logrotate.d/squid
|
||||
%attr(755,root,root) /etc/rc.d/init.d/squid
|
||||
%attr(755,root,root) /etc/logrotate.d/squid
|
||||
%{_datadir}/squid/icons
|
||||
%{_sbindir}/squid
|
||||
%{_sbindir}/squidclient
|
||||
|
Loading…
Reference in New Issue
Block a user