Bug 1247915 - When update squid package from squid-3.1.10-29.el6 to squid-3.1.23-9.el6.x86_64. Existing squid processes are not restarted in postuninstall scriptlet.
When update squid package from squid-3.1.10-29.el6 to squid-3.1.23-9.el6.x86_...
Status: CLOSED DUPLICATE of bug 1248855
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: squid (Show other bugs)
6.7
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Luboš Uhliarik
BaseOS QE - Apps
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-29 04:46 EDT by Keigo Noha
Modified: 2015-08-12 09:17 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 09:17:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Keigo Noha 2015-07-29 04:46:55 EDT
Description of problem:
When update squid package from squid-3.1.10-29.el6 to squid-3.1.23-9.el6.x86_64. Existing squid processes are not restarted in postuninstall scriptlet.

Version-Release number of selected component (if applicable):
squid-3.1.23-9.el6

How reproducible:
100 %

Steps to Reproduce:
1. Install squid-3.1.10-29 and start squid service.
2. Check squid process's pids with 'ps auxwww'
2. Update squid package with 'rpm -Uvh squid-3.1.23-9.el6.x86_64.rpm'
3. Check squid process's pids with 'ps auxwww'

Actual results:
squid processes are not restarted at package update.

Expected results:
squid processes are restartd at package update.

Additional info:

- Before update
~~~
# ps auxwww |grep squid
root      1505  0.0  0.3  71568  3284 ?        Ss   16:50   0:00 squid -f /etc/squid/squid.conf
squid     1508  0.1  1.0  74472 10644 ?        S    16:50   0:00 (squid) -f /etc/squid/squid.conf
squid     1509  0.0  0.1  20084  1064 ?        S    16:50   0:00 (unlinkd)
root      1512  0.0  0.0 103244   836 pts/0    S+   16:50   0:00 grep squid
~~~

- Run update
~~~
# rpm -Uvh -vv squid-3.1.23-9.el6.x86_64.rpm 
:
D:     erase: %postun(squid-7:3.1.10-29.el6.x86_64) scriptlet start
D:     erase: %postun(squid-7:3.1.10-29.el6.x86_64)	execv(/bin/sh) pid 1522
+ '[' 1 -ge 1 ']'
+ service squid condrestart
D:     erase: waitpid(1522) rc 1522 status 0 secs 100.115
D:   --- h#     285 squid-7:3.1.10-29.el6.x86_64
~~~

- After update
~~~
# ps auxwww |grep squid
root      1505  0.0  0.3  71568  3284 ?        Ss   16:50   0:00 squid -f /etc/squid/squid.conf
squid     1508  0.0  1.0  74472 10644 ?        S    16:50   0:00 (squid) -f /etc/squid/squid.conf
squid     1509  0.0  0.1  20084  1064 ?        S    16:50   0:00 (unlinkd)
root      1590  0.0  0.0 103244   836 pts/0    S+   16:54   0:00 grep squid
~~~

The PIDs are not changed.

In /etc/rc.d/init.d/squid,

condrestart() {
	[ -e /var/lock/subsys/squid ] && restart || :
}

After update, /var/lock/subsys/squid does not exits.

While the update, update process took much time at 'service squid condrestart'.
So, stop() function could not kill pre-existing squid process.
~~~
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
		else
			rm -f /var/lock/subsys/$SQUID
			RETVAL=$?
		fi
		echo
	fi
	return $RETVAL
}
~~~

After update, I tried to just do 'service squid restart'.
The command returns following error.
~~~
# service squid restart
Stopping squid: squid: ERROR: Could not send signal 15 to process 1746: (1) Operation not permitted
..................................................
Squid failed to stop in reasonable time and therefore wasn't started.
~~~

On the other hand, downgrade to squid-3.1.10-29.el6 can restart squid process successfully and does not take much time.
Comment 2 Luboš Uhliarik 2015-08-12 09:17:51 EDT
This issue is the duplicate of #1248855. The reason, why the PID file is same, is because, newer installed squid binary has no permissions to stop the old running one.

*** This bug has been marked as a duplicate of bug 1248855 ***

Note You need to log in before you can comment on or make changes to this bug.