Bug 17865

Summary: Upgrade over Obsoletes messes initscripts
Product: [Retired] Red Hat Linux Reporter: Pekka Savola <pekkas>
Component: opensshAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.0CC: pekkas
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-02 01:22:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pekka Savola 2000-09-26 18:23:14 UTC
This probably should be properly fixed in a more generic way, but as the problem appeared 
with SSH..

I was experiencing the following w/ upgrading from ssh ltd's ssh-1.2.xx to
OpenSSH 2.2.0p1:

1) before the upgrade, chkconfig --list sshd shows the service as 'on'.

2) Upgrade with rpm -Uvh openssh*.rpm, chkconfig --list is all 'off'
   * This shouldn't happen -- people wouldn't take this likely after
     boot..

Post/Pre (un)install scripts for RHL OpenSSH and the "official" OpenSSH
RPM seem to be effectively the same.

It'd look like that in the following:
----
preuninstall script (through /bin/sh):
if [ "$1" = 0 ]
then
        /sbin/service sshd stop > /dev/null 2>&1
        /sbin/chkconfig --del sshd
fi
----

if "$1" = 0 is fulfilled even in the upgrade when the old package is
obsoleted, and 
 
 1) sshd is stopped (this did happen)
 2) service is disabled (likewise)

OpenSSH -> OpenSSH upgrades work fine; the obsoletion is required 
for this bug to crop up.

Comment 1 Pekka Savola 2000-09-26 18:26:16 UTC
A patch suggested by H.J.Lu [tabs are probably mangled :(]:

--- openssh.spec        2000/09/16 00:44:13     1.1.1.5
+++ openssh.spec        2000/09/16 15:12:36     1.9
 %build
@@ -248,6 +248,25 @@ then
        /sbin/service sshd stop > /dev/null 2>&1
        /sbin/chkconfig --del sshd
 fi
+
+# Deal with the original ssh-server rpm.
+%triggerun server -- ssh-server
+if [ "$1" != 0 -a -r /var/run/sshd.pid ]
+then
+       touch /var/run/sshd.restart
+fi
+
+%triggerpostun server -- ssh-server
+if [ "$1" != 0 ]
+then
+       /sbin/chkconfig --add sshd
+       if test -f /var/run/sshd.restart
+       then
+               rm -f /var/run/sshd.restart
+               /etc/rc.d/init.d/sshd start >&2
+       fi
+fi
+
 
 %files
 %defattr(-,root,root)

Comment 2 Nalin Dahyabhai 2000-10-02 01:22:24 UTC
Ugh.  The package name changed, but the init script's didn't.

Comment 3 Pekka Savola 2001-01-01 13:55:18 UTC
Fixed in errata.