ports/145675: [Maintainer] www/squid30: move cache and log directories to /var/
Thomas-Martin Seck
tmseck at web.de
Tue Apr 13 17:30:02 UTC 2010
>Number: 145675
>Category: ports
>Synopsis: [Maintainer] www/squid30: move cache and log directories to /var/
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Tue Apr 13 17:30:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Thomas-Martin Seck
>Release: FreeBSD 8.0-RELEASE amd64
>Organization:
a private site in Germany
>Environment:
FreeBSD ports collection as of April 13, 2010.
>Description:
- update MASTER_SITES
- move default cache and log directories from $PREFIX/squid/ to /var/squid/
UPDATING entry:
Starting with 3.0.25_1 the directory containing the default cache and log
directory was changed from $PREFIX/squid/ to /var/squid/.
The default value for the following Squid configuration parameters
have changed as follows:
cache_log from $PREFIX/squid/logs/cache.log to /var/squid/logs/cache.log
cache_store_log from $PREFIX/squid/logs/store.log to /var/squid/logs/store.log
pid_filename from $PREFIX/squid/logs/squid.pid to /var/squid/logs/squid.pid
coredump_dir from $PREFIX/squid/cache to /var/squid/cache
Please check whether you need to define any of these variables in
your squid.conf to the old defaults explicitly before updating,
especially if you have set up automated log processing or automated
log rotation. If you define pid_filename in your squid.conf you
should also set squid_pidfile to the same value in /etc/rc.conf,
cf. $PREFIX/etc/rc.d/squid.
>How-To-Repeat:
>Fix:
Apply this patch:
Index: Makefile
===================================================================
--- Makefile (.../www/squid30) (Revision 1816)
+++ Makefile (.../local/squid30) (Revision 1816)
@@ -61,21 +61,22 @@
PORTNAME= squid
PORTVERSION= 3.0.${SQUID_STABLE_VER}
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
- ftp://mirrors.24-7-solutions.net/pub/squid/%SUBDIR%/ \
- ftp://ftp.belnet.be/packages/squid/pub/%SUBDIR%/ \
- ftp://ftp.nl.uu.net/pub/unix/www/squid/%SUBDIR%/ \
- ftp://ftp.mirrorservice.org/sites/ftp.squid-cache.org/pub/%SUBDIR%/ \
- ftp://ftp.ntua.gr/pub/www/Squid/%SUBDIR%/ \
- ftp://ftp.ccs.neu.edu/pub/mirrors/squid.nlanr.net/pub/%SUBDIR%/ \
- ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/squid/&,} \
+ http://mirrors.ccs.neu.edu/Squid/ \
+ ftp://ftp.fu-berlin.de/unix/www/squid/squid/ \
+ ftp://ftp.nl.uu.net/pub/unix/www/squid/ \
+ ftp://ftp.solnet.ch/mirror/squid/ \
+ ftp://ftp.ntua.gr/pub/www/Squid/squid/ \
+ http://mirror.aarnet.edu.au/pub/squid/squid/ \
+ ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/squid,} \
http://www.squid-cache.org/Versions/v3/3.0/ \
- http://www3.us.squid-cache.org/Versions/v3/3.0/ \
+ http://www2.us.squid-cache.org/Versions/v3/3.0/ \
http://www1.at.squid-cache.org/Versions/v3/3.0/ \
- http://www2.nl.squid-cache.org/Versions/v3/3.0/ \
- http://www1.ru.squid-cache.org/Versions/v3/3.0/ \
- http://www1.uk.squid-cache.org/Versions/v3/3.0/ \
+ http://www2.de.squid-cache.org/Versions/v3/3.0/ \
+ http://www.eu.squid-cache.org/Versions/v3/3.0/ \
+ http://www1.ie.squid-cache.org/Versions/v3/3.0/ \
http://www1.jp.squid-cache.org/Versions/v3/3.0/ \
http://www2.tw.squid-cache.org/Versions/v3/3.0/
MASTER_SITE_SUBDIR= squid
@@ -84,13 +85,12 @@
PATCH_SITES= http://www.squid-cache.org/%SUBDIR%/ \
http://www2.us.squid-cache.org/%SUBDIR%/ \
- http://www3.us.squid-cache.org/%SUBDIR%/ \
http://www1.at.squid-cache.org/%SUBDIR%/ \
- http://www2.nl.squid-cache.org/%SUBDIR%/ \
- http://www1.ru.squid-cache.org/%SUBDIR%/ \
- http://www1.uk.squid-cache.org/%SUBDIR%/ \
+ http://www2.de.squid-cache.org/%SUBDIR%/ \
+ http://www.eu.squid-cache.org/%SUBDIR%/ \
+ http://www1.ie.squid-cache.org/%SUBDIR%/ \
http://www1.jp.squid-cache.org/%SUBDIR%/ \
- http://www1.tw.squid-cache.org/%SUBDIR%/
+ http://www2.tw.squid-cache.org/%SUBDIR%/
PATCH_SITE_SUBDIR= Versions/v3/3.0/changesets
PATCHFILES=
@@ -190,7 +190,7 @@
--sbindir=${PREFIX}/sbin \
--datadir=${PREFIX}/etc/squid \
--libexecdir=${PREFIX}/libexec/squid \
- --localstatedir=${PREFIX}/squid \
+ --localstatedir=/var/squid \
--sysconfdir=${PREFIX}/etc/squid \
--enable-removal-policies="lru heap" \
--disable-linux-netfilter \
@@ -393,7 +393,7 @@
PLIST_DIRS+= etc/squid/errors/${d}
PLIST_FILES+= ${error_files:S,^,etc/squid/errors/${d}/,}
.endfor
-PLIST_DIRS+= etc/squid/errors etc/squid squid/logs squid/cache squid
+PLIST_DIRS+= etc/squid/errors etc/squid
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
Index: files/pkg-deinstall.in
===================================================================
--- files/pkg-deinstall.in (.../www/squid30) (Revision 1816)
+++ files/pkg-deinstall.in (.../local/squid30) (Revision 1816)
@@ -4,13 +4,21 @@
#
PATH=/bin:/usr/bin:/usr/sbin
+squid_base="/var/squid"
+squid_cachedir="${squid_base}/cache"
+squid_confdir=${PKG_PREFIX}/etc/squid
+squid_logdir="${squid_base}/logs"
case $2 in
DEINSTALL)
- cd ${PKG_PREFIX}/etc/squid || exit 1
+ cd ${squid_confdir} || exit 1
for f in cachemgr.conf mime.conf msntauth.conf squid.conf; do
cmp -s -z ${f} ${f}.default && rm ${f}
done
+ # try to cleanup directories in /var:
+ for d in ${squid_cachedir} ${squid_logdir} ${squid_base} ; do
+ rmdir ${d} 2>/dev/null
+ done
;;
POST-DEINSTALL)
echo "===> post-deinstallation information for $1:"
@@ -22,7 +30,7 @@
echo " created by a default installation of this package, run"
echo ""
echo " pw userdel -n %%SQUID_UID%% -u 100"
- if [ -d ${PKG_PREFIX}/squid -o -d ${PKG_PREFIX}/etc/squid ] ; then
+ if [ -d ${squid_base} -o -d ${squid_confdir} ] ; then
echo ""
echo " In order to ease updates the cache and log directories"
echo " and all configuration files modified by you were preserved."
Index: files/pkg-message.in
===================================================================
--- files/pkg-message.in (.../www/squid30) (Revision 1816)
+++ files/pkg-message.in (.../local/squid30) (Revision 1816)
@@ -1,8 +1,8 @@
o You can find the configuration files for this package in the
directory %%PREFIX%%/etc/squid.
- o A cache directory has been created in %%PREFIX%%/squid/cache.
- Log files will be written to %%PREFIX%%/squid/logs.
+ o The default cache directory is /var/squid/cache.
+ The default log directory is /var/squid/logs.
Note:
You must initialize new cache directories before you can start
@@ -10,14 +10,11 @@
If your cache directories are already initialized (e.g. after an
upgrade of squid) you do not need to initialize them again.
- o The default configuration will deny everyone access to the
- proxy service. Edit the "http_access" directives in
+ o The default configuration will deny everyone but local networks
+ as defined in RFC 1918 access to the proxy service.
+ Edit the "http_access allow/deny" directives in
%%PREFIX%%/etc/squid/squid.conf to suit your needs.
- Please note that the Squid start script is an rc.d style script.
- This means that Squid will not start automatically at boot
- time unless it is explicitly enabled.
-
To enable Squid, set squid_enable=yes in either
/etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid
Please see %%PREFIX%%/etc/rc.d/squid for further details.
@@ -29,4 +26,3 @@
Additionally, you should check your configuration by calling
'squid -f /path/to/squid.conf -k parse' before starting Squid.
-
Index: files/pkg-install.in
===================================================================
--- files/pkg-install.in (.../www/squid30) (Revision 1816)
+++ files/pkg-install.in (.../local/squid30) (Revision 1816)
@@ -5,7 +5,7 @@
PATH=/bin:/usr/bin:/usr/sbin
pkgname=$1
-squid_base="${PKG_PREFIX:-%%PREFIX%%}/squid"
+squid_base="/var/squid"
squid_confdir="${PKG_PREFIX:-%%PREFIX%%}/etc/squid"
if [ -x /usr/sbin/nologin ]; then
nologin=/usr/sbin/nologin
Index: files/squid.in
===================================================================
--- files/squid.in (.../www/squid30) (Revision 1816)
+++ files/squid.in (.../local/squid30) (Revision 1816)
@@ -13,7 +13,7 @@
# Additional variables you can define in one of these files:
#
# squid_chdir: the directory into which the rc system moves into before
-# starting Squid. Default: %%PREFIX%%/squid
+# starting Squid. Default: /var/squid/logs
#
# squid_conf: The configuration file that Squid should use.
# Default: %%PREFIX%%/etc/squid/squid.conf
@@ -32,7 +32,7 @@
# squid_pidfile:
# The name (including the full path) of the Squid
# master process' PID file.
-# Default: %%PREFIX%%/squid/logs/squid.pid.
+# Default: /var/squid/logs/squid.pid.
# You only need to change this if you changed the
# corresponding entry in your Squid configuration.
#
@@ -73,12 +73,12 @@
load_rc_config ${name}
-squid_chdir=${squid_chdir:-"%%PREFIX%%/squid/logs"}
+squid_chdir=${squid_chdir:-"/var/squid/logs"}
squid_conf=${squid_conf:-"%%PREFIX%%/etc/squid/squid.conf"}
squid_enable=${squid_enable:-"NO"}
squid_fib=${squid_fib:-"NONE"}
squid_flags=${squid_flags-"-D"}
-squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/logs/squid.pid"}
+squid_pidfile=${squid_pidfile:-"/var/squid/logs/squid.pid"}
squid_user=${squid_user:-%%SQUID_UID%%}
pidfile=${squid_pidfile}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list