Related: #1709299 - Use upstream squid.service

This commit is contained in:
Lubos Uhliarik 2019-05-21 17:08:18 +02:00
parent f109435113
commit e795ebc437
3 changed files with 13 additions and 6 deletions

View File

@ -8,9 +8,14 @@ SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
CACHE_SWAP=`sed -e 's/#.*//g' $SQUID_CONF | \
grep cache_dir | awk '{ print $3 }'`
init_cache_dirs=0
for adir in $CACHE_SWAP; do
if [ ! -d $adir/00 ]; then
echo -n "init_cache_dir $adir... "
squid -N -z -F -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
init_cache_dirs=1
fi
done
if [ $init_cache_dirs -ne 0 ]; then
squid --foreground -z -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
fi

View File

@ -6,12 +6,12 @@ After=network.target network-online.target nss-lookup.target
[Service]
Type=forking
LimitNOFILE=16384
PIDFile=/var/run/squid.pid
EnvironmentFile=/etc/sysconfig/squid
ExecStartPre=/usr/libexec/squid/cache_swap.sh
ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF
ExecReload=/usr/sbin/squid $SQUID_OPTS -k reconfigure -f $SQUID_CONF
ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF
TimeoutSec=0
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
[Install]
WantedBy=multi-user.target

View File

@ -2,7 +2,7 @@
Name: squid
Version: 4.7
Release: 1%{?dist}
Release: 2%{?dist}
Summary: The Squid proxy caching server
Epoch: 7
# See CREDITS for breakdown of non GPLv2+ code
@ -137,7 +137,6 @@ autoconf
--with-openssl \
--with-pthreads \
--disable-arch-native \
--with-pic \
--disable-security-cert-validators \
--disable-strict-error-checking \
--with-swapdir=%{_localstatedir}/spool/squid
@ -283,6 +282,9 @@ fi
%changelog
* Tue May 21 2019 Lubos Uhliarik <luhliari@redhat.com> - 7:4.7-2
- Related: #1709299 - Use upstream squid.service
* Fri May 17 2019 Luboš Uhliarik <luhliari@redhat.com> - 7:4.7-1
- new version 4.7