Opened 10 years ago

Closed 2 years ago

#47709 closed enhancement (fixed)

Squid3 Squid.wrapper suggest

Reported by: plm_macports@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc:
Port: squid3

Description

Hi,

I had a lot of problems to start Squid3 and don't understand why. I could start Squid directly with a "squid -s" but not with launchctl plist or directly with the wrapper.

The origin was that my configuration of "cache_dir" was in an other repertory than default. The wrapper test directly the "/opt/local/var/squid/cache" directory to test if cache directories exists…

So, I suggest to modify the "Squid.wrapper" script to test in "squid.conf" file if "cache_dir" is set to default.

A little bit like this:

#!/bin/bash
………
if eval grep -q '^cache_dir ' /opt/local/etc/squid/squid.conf ; then
	CacheDir="$(grep '^cache_dir ' /opt/local/etc/squid/squid.conf | awk '{ print $3 }')"
else
	CacheDir="/opt/local/var/squid/cache"
fi
………
Start()
{
	cd /opt/local/var/squid
	if [ ! -d "${CacheDir}/00" ]; then
	    /opt/local/sbin/squid -s -z
	fi
	/opt/local/sbin/squid -s
}
………

Best regards

Change History (2)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jmr removed
Milestone: MacPorts Future
Owner: changed from macports-tickets@… to jmr@…
Port: squid3 added
Type: submissionenhancement

comment:2 Changed 2 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

The startupitem no longer tries to create the cache dirs as of squid4.

Note: See TracTickets for help on using tickets.