Configure squid to create PID file by default, use SQUID_ARGS variable,
wait for it to actually stop when stopping (takes some time for squid
to do it).
Signed-off-by: Roman I Khimov <khimov@altell.ru>
DESCRIPTION = "Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more"
LICENSE = "GPLv2"
-INC_PR = "r3"
+INC_PR = "r4"
DEPENDS = "squid-native-${PV}"
SRC_URI = "http://www.squid-cache.org/Versions/v2/${SQUID_MAJOR}/squid-${PV}.tar.bz2;name=squid-${PV} \
mv ${D}${sysconfdir}/mime.conf.default ${D}${sysconfdir}/squid/
mv ${D}${sysconfdir}/squid.conf.default ${D}${sysconfdir}/squid/
install -m 0644 ${WORKDIR}/squid-volatiles ${D}${sysconfdir}/default/volatiles/squid
+ sed -ri "s,^\#?\ *(pid_filename.+)$,\1," ${D}${sysconfdir}/squid/squid.conf
}
# this packages the languages better and saves some space, installs
NAME=squid
DESC="Squid HTTP proxy"
PIDFILE=/var/run/squid.pid
-SQUID_ARGS="-D -sYC"
+SQUID_ARGS="-D -sY"
test -f $DAEMON || exit 0
chown $owner $ldr
fi
- start-stop-daemon -S -p $PIDFILE -x $DAEMON
+ start-stop-daemon -S -p $PIDFILE -x $DAEMON -- $SQUID_ARGS
}
stop() {
- start-stop-daemon -K -p $PIDFILE -x $DAEMON
+ EX=0
+ CNT=1
+ while [ $EX -eq 0 -a $CNT -lt 15 ]; do
+ echo -n .
+ sleep 1
+ start-stop-daemon -K -p $PIDFILE 1>/dev/null 2>&1
+ EX=$?
+ CNT=`expr $CNT + 1`
+ done
+ if [ $CNT -eq 15 ]; then
+ echo "failed."
+ else
+ echo "done."
+ rm -f $PIDFILE
+ fi
}
case "$1" in
echo "done."
;;
stop)
- echo -n "Stopping $DESC: $NAME... "
+ echo -n "Stopping $DESC: $NAME"
stop
- echo "done."
;;
restart)
echo "Restarting $DESC: $NAME... "