RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/
Bug 980292 - preunsintall script of openstack-quantum-openvswitch.noarch needs to disable/stop quantum-ovs-cleanup.service
Summary: preunsintall script of openstack-quantum-openvswitch.noarch needs to disable/...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: RDO
Classification: Community
Component: openstack-neutron
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Terry Wilson
QA Contact: Ofer Blaut
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-02 02:09 UTC by Etsuji Nakai
Modified: 2016-04-26 17:42 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
: 980389 (view as bug list)
Environment:
Last Closed: 2015-03-18 16:24:46 UTC
Embargoed:


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

Description Etsuji Nakai 2013-07-02 02:09:12 UTC
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 14:54:24 UTC
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 20:45:06 UTC
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 18:24:45 UTC
Indeed you are correct, it should be disabled.  Sorry for missing that.

Comment 6 Lars Kellogg-Stedman 2014-02-10 17:04:20 UTC
Created attachment 861494 [details]
Patch to disable neutron-ovs-cleanup on uninstall

Comment 7 Lars Kellogg-Stedman 2014-02-10 17:05:16 UTC
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 16:24:46 UTC
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.