Bug #3698

Can't uninstall package opennebula-server if service not running

Added by Edouard Bourguignon over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:03/20/2015
Priority:NormalDue date:
Assignee:Javi Fontan% Done:

0%

Category:Packaging
Target version:Release 4.12.1
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.12

Description

Hi,

It seems there is a problem with the postun scriptlets in the rpm. It suppose that the service is running, and if it's not the case, fails to run this postun script. Therefor, yum/rpm is not able to uninstall this package.

The best practice for RPM scriptlet for that specific case is to return true:

    preuninstall scriptlet (using /bin/sh):
    if [ $1 = 0 ]; then
        /sbin/service opennebula stop >/dev/null
        /sbin/chkconfig --del opennebula >/dev/null
    fi

to

    preuninstall scriptlet (using /bin/sh):
    if [ $1 = 0 ]; then
          /sbin/service opennebula stop >/dev/null ||:
          /sbin/chkconfig --del opennebula >/dev/null
    fi

Btw I can't find the spec files in the git repos?

History

#1 Updated by Edouard Bourguignon over 6 years ago

I forgot: The workaround:

rpm -e opennebula-server --noscripts

#2 Updated by Ruben S. Montero over 6 years ago

  • Target version set to Release 4.12.1

#3 Updated by Javi Fontan over 6 years ago

  • Status changed from Pending to Closed
  • Assignee set to Javi Fontan
  • Resolution set to fixed

Changed CentOS 6 and 7 scripts.

Thanks!

Also available in: Atom PDF