[MacPorts] #33436: Squid3 fails to restart correctly
MacPorts
noreply at macports.org
Sat Mar 3 09:51:34 PST 2012
#33436: Squid3 fails to restart correctly
---------------------------------------+------------------------------------
Reporter: dan+macports@… | Owner: jmr@…
Type: defect | Status: reopened
Priority: Normal | Milestone:
Component: ports | Version: 2.0.3
Resolution: | Keywords:
Port: squid3 |
---------------------------------------+------------------------------------
Comment(by dan+macports@…):
Replying to [comment:11 dan+macports@…]:
[...]
| Where is the source code of "daemondo"?
Found it. And the cause of my problems is:
{{{
const CFTimeInterval kChildDeathTimeout = 20.0;
}}}
Hence I can't use a shell script as "Squid.wrapper" to wait for a real
squid shutdown.
I found another workaround, based on 2 modif. within
${prefix}/etc/LaunchDaemons/org.macports.Squid
daemondo will use the standard pidfile of squid,
Squid.wrapper will be simpler.
{{{
*** org.macports.Squid.plist 2012/02/29 17:13:27 1.1
--- org.macports.Squid.plist 2012/03/03 17:47:52
***************
*** 21,30 ****
<string>restart</string>
<string>;</string>
<string>--restart-netchange</string>
! <string>--pid=none</string>
</array>
<key>Debug</key><false/>
! <key>Disabled</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>
--- 21,31 ----
<string>restart</string>
<string>;</string>
<string>--restart-netchange</string>
! <string>--pid=fileauto</string>
! <string>--pidfile=/opt/var/run/squid/squid.pid</string>
</array>
<key>Debug</key><false/>
! <key>RunAtLoad</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>
}}}
{{{
*** Squid.wrapper 2012/03/02 14:24:40 1.1
--- Squid.wrapper 2012/03/03 17:56:10
***************
*** 15,23 ****
{
cd /opt/var/squid
if [ ! -d "/opt/var/squid/cache/00" ]; then
! su -fm root -c "exec /opt/sbin/squid -s -z"
fi
! su -fm root -c "exec /opt/sbin/squid -s"
}
#
--- 15,23 ----
{
cd /opt/var/squid
if [ ! -d "/opt/var/squid/cache/00" ]; then
! /opt/sbin/squid -s -z
fi
! /opt/sbin/squid -s
}
#
***************
*** 26,32 ****
Stop()
{
cd /opt/var/squid
! su -fm root -c "exec /opt/sbin/squid -k shutdown"
}
#
--- 26,32 ----
Stop()
{
cd /opt/var/squid
! /opt/sbin/squid -k shutdown
}
#
}}}
Tests done so far:
{{{
Squid.wrapper restart
launchctl start org.macports.Squid.plist
launchctl stop org.macports.Squid.plist
reboot
switch Location
}}}
--
Ticket URL: <https://trac.macports.org/ticket/33436#comment:12>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list