Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 291911 - net-proxy/squid stop waits although there is "No running copy"
Summary: net-proxy/squid stop waits although there is "No running copy"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Network Proxy Developers (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-04 20:55 UTC by Johannes Buchner
Modified: 2009-11-28 13:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Buchner 2009-11-04 20:55:37 UTC
On stop, the service script of squid waits for the pid file to disappear even if there is no squid running that could remove it.

Reproduce:
 - start squid 
 - kill squid
 - stop squid 

The problem in the /etc/init.d/squid file:
/usr/sbin/squid -k shutdown terminates with exit status 1 when the process is not there anymore (the pid file still is). Which means the stop script waits for no reason.

I changed

stop() {
	ebegin "Stopping ${SVCNAME}"
	/usr/sbin/squid -k shutdown -f /etc/squid/${SVCNAME}.conf
        # Now we have to wait until squid has _really_ stopped.

to 

stop() {
	ebegin "Stopping ${SVCNAME}"
	if ! /usr/sbin/squid -k shutdown -f /etc/squid/${SVCNAME}.conf; then 
		einfo "Squid couldn't shutdown. Probably already down."
		eend 0
		return
	fi
	# Now we have to wait until squid has _really_ stopped.

not sure if that is the correct error code (eend). Either way, this solves the unnecessary (long) wait.

This is the same as Bug #189005, which was resolved as upstream. The bug (poorly described) is the Gentoo init script though. 

Please consider applying the changes.
Comment 1 Simeon Maryasin 2009-11-18 23:49:48 UTC
eend 0 must be correct, or else /etc/init.d/squid will not set state to "stopped".
I think we must replace einfo with ewarn or even eerror, because it is not good thing.
Comment 2 Alin Năstac (RETIRED) gentoo-dev 2009-11-28 12:33:16 UTC
Fixed in cvs.
Comment 3 Johannes Buchner 2009-11-28 13:21:27 UTC
Thank you