Bug 17865 - Upgrade over Obsoletes messes initscripts
Summary: Upgrade over Obsoletes messes initscripts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: openssh
Version: 7.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-09-26 18:23 UTC by Pekka Savola
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-10-02 01:22:27 UTC
Embargoed:


Attachments (Terms of Use)

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.


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