Bug 980292 - preunsintall script of openstack-quantum-openvswitch.noarch needs to disable/stop quantum-ovs-cleanup.service
preunsintall script of openstack-quantum-openvswitch.noarch needs to disable/...
Status: CLOSED UPSTREAM
Product: RDO
Classification: Community
Component: openstack-neutron (Show other bugs)
unspecified
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Terry Wilson
Ofer Blaut
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-01 22:09 EDT by Etsuji Nakai
Modified: 2016-04-26 13:42 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 980389 (view as bug list)
Environment:
Last Closed: 2015-03-18 12:24:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to disable neutron-ovs-cleanup on uninstall (1.38 KB, patch)
2014-02-10 12:04 EST, Lars Kellogg-Stedman
no flags Details | Diff

  None (edit)
Description Etsuji Nakai 2013-07-01 22:09:12 EDT
Description of problem:

preunsintall scriptlet of openstack-quantum-openvswitch disable/stop only quantum-openvswitch-agent.service as below:

======
# rpm -q --scripts openstack-quantum-openvswitch.noarch
preuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable quantum-openvswitch-agent.service > /dev/null 2>&1 || :
    /bin/systemctl stop quantum-openvswitch-agent.service > /dev/null 2>&1 || :
fi
postuninstall scriptlet (using /bin/sh):
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /bin/systemctl try-restart quantum-openvswitch-agent.service >/dev/null 2>&1 || :
fi

======

But this package provides quantum-ovs-cleanup.service, too. So it should disable/stop this, too, in preunstall scriptlet.


Without it, when you reinstall openstack-quantum-openvswitch, quantum-ovs-cleanup.service fails to start.

1) enable/start quantum-ovs-cleanup.service.
# systemctl enable quantum-ovs-cleanup.service
# systemctl start quantum-ovs-cleanup.service 

2) Reinstall openstack-quantum-openvswitch.
# yum remove openstack-quantum-openvswitch
# yum install openstack-quantum-openvswitch

3) quantum-ovs-cleanup.service fails to start.
# systemctl start quantum-ovs-cleanup.service 
Failed to issue method call: Unit quantum-ovs-cleanup.service failed to load: No such file or directory. See system logs and 'systemctl status quantum-ovs-cleanup.service' for details.


Version-Release number of selected component (if applicable):

# rpm -q openstack-quantum-openvswitch
openstack-quantum-openvswitch-2012.2.3-2.fc18.noarch
Comment 3 Lars Kellogg-Stedman 2014-01-15 09:54:24 EST
The (neutron|quantum)-ovs-cleanup service does not need to be stopped because it is not a persistent service.  It only runs at boot and then exits.  See "Type=oneshot" in the unit file:

[Unit]
Description=OpenStack Quantum Open vSwitch Cleanup Utility
After=syslog.target network.target openvswitch.service
Before=neutron-openvswitch-agent.service neutron-dhcp-agent.service neutron-l3-agent.service openstack-nova-compute.service

[Service]
Type=oneshot
User=neutron
ExecStart=/usr/bin/neutron-ovs-cleanup --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini --log-file /var/log/neutron/ovs-cleanup.log
PrivateTmp=true

[Install]
WantedBy=multi-user.target
Comment 4 Etsuji Nakai 2014-01-15 15:45:06 EST
No, even if it's oneshot type service, uninstall postlet needs to "disable" it. Without that, there remains a dead symlink: /etc/systemd/system/multi-user.target.wants/quantum-ovs-cleanup.service

And this causes a _real_ problem. First, because of this dead link, systemd recognizes it as a "misconfigured service" even though it's removed from the system.

-----
# yum install openstack-quantum-openvswitch
# systemctl enable quantum-ovs-cleanup.service 
# yum remove openstack-quantum-openvswitch
# systemctl status quantum-ovs-cleanup.service
quantum-ovs-cleanup.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)
-----

Second, becuase of this, if a user re-installed it and tried to start it, it _fails_ to start.

-----
# yum install openstack-quantum-openvswitch
# systemctl start quantum-ovs-cleanup.service 
Failed to issue method call: Unit quantum-ovs-cleanup.service failed to load: No such file or directory. See system logs and 'systemctl status quantum-ovs-cleanup.service' for details.
---

Please reopen this issue.
Comment 5 Lars Kellogg-Stedman 2014-01-16 13:24:45 EST
Indeed you are correct, it should be disabled.  Sorry for missing that.
Comment 6 Lars Kellogg-Stedman 2014-02-10 12:04:20 EST
Created attachment 861494 [details]
Patch to disable neutron-ovs-cleanup on uninstall
Comment 7 Lars Kellogg-Stedman 2014-02-10 12:05:16 EST
I don't have commit access to the Fedora package, so I've just attached a patch here.  This has the %preun scriptlet disable the neutron-ovs-cleanup service as described in this bz.
Comment 8 Lars Kellogg-Stedman 2015-03-18 12:24:46 EDT
Change submitted upstream:

https://review.gerrithub.io/#/c/221598/

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