Remove sysvinit subpackage
Enable rock store
This commit is contained in:
parent
431df598c6
commit
37600470db
180
squid.init
180
squid.init
@ -1,180 +0,0 @@
|
||||
#!/bin/bash
|
||||
# chkconfig: - 90 25
|
||||
# pidfile: /var/run/squid.pid
|
||||
# config: /etc/squid/squid.conf
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: squid
|
||||
# Short-Description: starting and stopping Squid Internet Object Cache
|
||||
# Description: Squid - Internet Object Cache. Internet object caching is \
|
||||
# a way to store requested Internet objects (i.e., data available \
|
||||
# via the HTTP, FTP, and gopher protocols) on a system closer to the \
|
||||
# requesting site than to the source. Web browsers can then use the \
|
||||
# local Squid cache as a proxy HTTP server, reducing access time as \
|
||||
# well as bandwidth consumption.
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
PATH=/usr/bin:/sbin:/bin:/usr/sbin
|
||||
export PATH
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
if [ -f /etc/sysconfig/squid ]; then
|
||||
. /etc/sysconfig/squid
|
||||
fi
|
||||
|
||||
# don't raise an error if the config file is incomplete
|
||||
# set defaults instead:
|
||||
SQUID_OPTS=${SQUID_OPTS:-""}
|
||||
SQUID_PIDFILE_TIMEOUT=${SQUID_PIDFILE_TIMEOUT:-20}
|
||||
SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100}
|
||||
SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
|
||||
|
||||
# determine the name of the squid binary
|
||||
[ -f /usr/sbin/squid ] && SQUID=squid
|
||||
|
||||
prog="$SQUID"
|
||||
|
||||
# determine which one is the cache_swap directory
|
||||
CACHE_SWAP=`sed -e 's/#.*//g' $SQUID_CONF | \
|
||||
grep cache_dir | awk '{ print $3 }'`
|
||||
|
||||
RETVAL=0
|
||||
|
||||
probe() {
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
[ `id -u` -ne 0 ] && exit 4
|
||||
|
||||
# check if the squid conf file is present
|
||||
[ -f $SQUID_CONF ] || exit 6
|
||||
}
|
||||
|
||||
start() {
|
||||
probe
|
||||
|
||||
parse=`$SQUID -k parse -f $SQUID_CONF 2>&1`
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -ne 0 ]; then
|
||||
echo -n $"Starting $prog: "
|
||||
echo_failure
|
||||
echo
|
||||
echo "$parse"
|
||||
return 1
|
||||
fi
|
||||
for adir in $CACHE_SWAP; do
|
||||
if [ ! -d $adir/00 ]; then
|
||||
echo -n "init_cache_dir $adir... "
|
||||
$SQUID -z -F -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
|
||||
fi
|
||||
done
|
||||
echo -n $"Starting $prog: "
|
||||
$SQUID $SQUID_OPTS -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
timeout=0;
|
||||
while : ; do
|
||||
[ ! -f /var/run/squid.pid ] || break
|
||||
if [ $timeout -ge $SQUID_PIDFILE_TIMEOUT ]; then
|
||||
RETVAL=1
|
||||
break
|
||||
fi
|
||||
sleep 1 && echo -n "."
|
||||
timeout=$((timeout+1))
|
||||
done
|
||||
fi
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID
|
||||
[ $RETVAL -eq 0 ] && echo_success
|
||||
[ $RETVAL -ne 0 ] && echo_failure
|
||||
echo
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
$SQUID -k check -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
$SQUID -k shutdown -f $SQUID_CONF &
|
||||
rm -f /var/lock/subsys/$SQUID
|
||||
timeout=0
|
||||
while : ; do
|
||||
[ -f /var/run/squid.pid ] || break
|
||||
if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then
|
||||
echo
|
||||
return 1
|
||||
fi
|
||||
sleep 2 && echo -n "."
|
||||
timeout=$((timeout+2))
|
||||
done
|
||||
echo_success
|
||||
echo
|
||||
else
|
||||
echo_failure
|
||||
if [ ! -e /var/lock/subsys/$SQUID ]; then
|
||||
RETVAL=0
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
reload() {
|
||||
$SQUID $SQUID_OPTS -k reconfigure -f $SQUID_CONF
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
condrestart() {
|
||||
[ -e /var/lock/subsys/squid ] && restart || :
|
||||
}
|
||||
|
||||
rhstatus() {
|
||||
status $SQUID && $SQUID -k check -f $SQUID_CONF
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
|
||||
reload|force-reload)
|
||||
reload
|
||||
;;
|
||||
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
|
||||
condrestart|try-restart)
|
||||
condrestart
|
||||
;;
|
||||
|
||||
status)
|
||||
rhstatus
|
||||
;;
|
||||
|
||||
probe)
|
||||
probe
|
||||
;;
|
||||
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|reload|force-reload|restart|try-restart|probe}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
68
squid.spec
68
squid.spec
@ -1,10 +1,8 @@
|
||||
## % define _use_internal_dependency_generator 0
|
||||
%define __perl_requires %{SOURCE98}
|
||||
## % define __find_requires %{SOURCE99}
|
||||
|
||||
Name: squid
|
||||
Version: 3.4.5
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: The Squid proxy caching server
|
||||
Epoch: 7
|
||||
# See CREDITS for breakdown of non GPLv2+ code
|
||||
@ -13,21 +11,18 @@ Group: System Environment/Daemons
|
||||
URL: http://www.squid-cache.org
|
||||
Source0: http://www.squid-cache.org/Versions/v3/3.4/squid-%{version}.tar.xz
|
||||
Source1: http://www.squid-cache.org/Versions/v3/3.4/squid-%{version}.tar.xz.asc
|
||||
Source2: squid.init
|
||||
Source3: squid.logrotate
|
||||
Source4: squid.sysconfig
|
||||
Source5: squid.pam
|
||||
Source6: squid.nm
|
||||
Source7: squid.service
|
||||
Source8: cache_swap.sh
|
||||
Source2: squid.logrotate
|
||||
Source3: squid.sysconfig
|
||||
Source4: squid.pam
|
||||
Source5: squid.nm
|
||||
Source6: squid.service
|
||||
Source7: cache_swap.sh
|
||||
|
||||
Source98: perl-requires-squid.sh
|
||||
## Source99: filter-requires-squid.sh
|
||||
|
||||
# Upstream patches
|
||||
|
||||
|
||||
# Backported patches
|
||||
#Patch101: squid-3.2-mem_node.patch
|
||||
|
||||
# Local patches
|
||||
# Applying upstream patches first makes it less likely that local patches
|
||||
@ -84,16 +79,6 @@ Squid consists of a main server program squid, a Domain Name System
|
||||
lookup program (dnsserver), a program for retrieving FTP data
|
||||
(ftpget), and some management and client tools.
|
||||
|
||||
%package sysvinit
|
||||
Group: System Environment/Daemons
|
||||
Summary: SysV initscript for squid caching proxy
|
||||
Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
Requires(preun): /sbin/service
|
||||
Requires(postun): /sbin/service
|
||||
|
||||
%description sysvinit
|
||||
The squid-sysvinit contains SysV initscritps support.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
@ -121,9 +106,9 @@ The squid-sysvinit contains SysV initscritps support.
|
||||
LDFLAGS="$RPM_LD_FLAGS -pie -Wl,-z,relro -Wl,-z,now"
|
||||
|
||||
%configure \
|
||||
--exec_prefix=/usr \
|
||||
--exec_prefix=%{_prefix} \
|
||||
--libexecdir=%{_libdir}/squid \
|
||||
--localstatedir=/var \
|
||||
--localstatedir=%{_localstatedir} \
|
||||
--datadir=%{_datadir}/squid \
|
||||
--sysconfdir=%{_sysconfdir}/squid \
|
||||
--with-logdir='%{_localstatedir}/log/squid' \
|
||||
@ -152,7 +137,8 @@ LDFLAGS="$RPM_LD_FLAGS -pie -Wl,-z,relro -Wl,-z,now"
|
||||
--enable-snmp \
|
||||
--enable-ssl \
|
||||
--enable-ssl-crtd \
|
||||
--enable-storeio="aufs,diskd,ufs" \
|
||||
--enable-storeio="aufs,diskd,ufs,rock" \
|
||||
--enable-diskio \
|
||||
--enable-wccpv2 \
|
||||
--enable-esi \
|
||||
--enable-ecap \
|
||||
@ -163,7 +149,7 @@ LDFLAGS="$RPM_LD_FLAGS -pie -Wl,-z,relro -Wl,-z,now"
|
||||
--with-pthreads
|
||||
|
||||
make \
|
||||
DEFAULT_SWAP_DIR='$(localstatedir)/spool/squid' \
|
||||
DEFAULT_SWAP_DIR=%{_localstatedir}/spool/squid \
|
||||
%{?_smp_mflags}
|
||||
|
||||
%check
|
||||
@ -197,14 +183,13 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/squid
|
||||
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/squid
|
||||
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/squid
|
||||
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/squid
|
||||
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/squid
|
||||
install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_unitdir}
|
||||
install -m 755 %{SOURCE8} $RPM_BUILD_ROOT%{_libexecdir}/squid
|
||||
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/squid
|
||||
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/squid
|
||||
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/squid
|
||||
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}
|
||||
install -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_libexecdir}/squid
|
||||
install -m 644 $RPM_BUILD_ROOT/squid.httpd.tmp $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/squid.conf
|
||||
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/20-squid
|
||||
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/20-squid
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/squid
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/squid
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/squid
|
||||
@ -268,9 +253,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/squid/*
|
||||
%{_datadir}/snmp/mibs/SQUID-MIB.txt
|
||||
|
||||
%files sysvinit
|
||||
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/squid
|
||||
|
||||
%pre
|
||||
if ! getent group squid >/dev/null 2>&1; then
|
||||
/usr/sbin/groupadd -g 23 squid
|
||||
@ -306,15 +288,13 @@ fi
|
||||
/usr/sbin/usermod -a -G wbpriv squid >/dev/null 2>&1 || \
|
||||
chgrp squid /var/cache/samba/winbindd_privileged >/dev/null 2>&1 || :
|
||||
|
||||
%triggerun -- %{name} < 7:3.2.0.9-1
|
||||
/sbin/chkconfig --del squid >/dev/null 2>&1 || :
|
||||
/bin/systemctl try-restart squid.service >/dev/null 2>&1 || :
|
||||
|
||||
%triggerpostun -n %{name}-sysvinit -- %{name} < 7:3.2.0.9-1
|
||||
/sbin/chkconfig --add squid >/dev/null 2>&1 || :
|
||||
|
||||
%changelog
|
||||
* Fri May 23 2014 Michal Luscon <mluscon@redhat.com> - 7:3.5.5-2
|
||||
* Tue May 27 2014 Michal Luscon <mluscon@redhat.com> - 7:3.4.5-3
|
||||
- Remove sysvinit subpackage
|
||||
- Enable rock store
|
||||
|
||||
* Fri May 23 2014 Michal Luscon <mluscon@redhat.com> - 7:3.4.5-2
|
||||
- Fixed #1099970: missing /var/run/squid folder
|
||||
- Reverted #1038160: breaks SMP mode
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user