Bug 17865 - Upgrade over Obsoletes messes initscripts
Upgrade over Obsoletes messes initscripts
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: openssh (Show other bugs)
7.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-09-26 14:23 EDT by Pekka Savola
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-01 21:22:27 EDT
Type: ---
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 Pekka Savola 2000-09-26 14:23:14 EDT
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 14:26:16 EDT
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-01 21:22:24 EDT
Ugh.  The package name changed, but the init script's didn't.
Comment 3 Pekka Savola 2001-01-01 08:55:18 EST
Fixed in errata.

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