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.
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)
Ugh. The package name changed, but the init script's didn't.
Fixed in errata.