RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/
Bug 984097 - Neutron rootwrap does not follow packaging guidelines
Summary: Neutron rootwrap does not follow packaging guidelines
Keywords:
Status: CLOSED CURRENTRELEASE
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: 1039528 1039774 1129685
TreeView+ depends on / blocked
 
Reported: 2013-07-12 18:54 UTC by dara
Modified: 2016-04-26 16:57 UTC (History)
4 users (show)

Fixed In Version: openstack-neutron-2013.2-13.el6
Clone Of:
: 1039528 1039774 (view as bug list)
Environment:
Last Closed: 2014-04-07 17:19:32 UTC
Embargoed:


Attachments (Terms of Use)

Description dara 2013-07-12 18:54:10 UTC
Description of problem:

This file is wrong and makes quantum rootwrap ineffective:

# tail -1 /etc/sudoers.d/quantum 
quantum ALL = (root) NOPASSWD: SETENV: /usr/bin/quantum-rootwrap


It should be simliar to nova and cinder and specify parameters, ie:

# tail -1 /etc/sudoers.d/nova 
nova ALL = (root) NOPASSWD: /usr/bin/nova-rootwrap /etc/nova/rootwrap.conf *



See https://wiki.openstack.org/wiki/Packager/Rootwrap


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

# rpm -qf /etc/sudoers.d/quantum
openstack-quantum-2013.1.2-1.el6.noarch

# cat /etc/centos-release 
CentOS release 6.4 (Final)

Comment 1 Kashyap Chamarthy 2013-12-09 10:46:43 UTC
Can any Neutron folks confirm if the below fix is appropriate:

$ fedpkg clone -B -a openstack-neutron

$ cd openstack-neutron/master

Edit neutron-sudoers file to reflect
 
 neutron ALL = (root) NOPASSWD: /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf *

$ git diff 
diff --git a/neutron-sudoers b/neutron-sudoers
index 3786ada..b5448c8 100644
--- a/neutron-sudoers
+++ b/neutron-sudoers
@@ -1,3 +1,3 @@
 Defaults:neutron !requiretty
 
-neutron ALL = (root) NOPASSWD: SETENV: /usr/bin/neutron-rootwrap
+neutron ALL = (root) NOPASSWD: /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf *

Comment 2 Terry Wilson 2013-12-10 00:19:13 UTC
The correct fix is as you suspected:

-neutron ALL = (root) NOPASSWD: SETENV: /usr/bin/neutron-rootwrap
+neutron ALL = (root) NOPASSWD: /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf *

I've fixed this locally and tested it. Build coming soon.

Comment 3 Kashyap Chamarthy 2013-12-14 13:32:11 UTC
Terry, 

Thanks for the fix. Just to note, shouldn't we need to push the same to Rawhide (F21 ), F20, branches so they can be made available for Fedora RDO users?

Currently:

# On Rawhide/F21
$ koji latest-build f21 openstack-neutron
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
openstack-neutron-2013.2-6.fc21           f21                   otherwiseguy


# On Fedora-20
$ koji latest-build f20 openstack-neutron
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
openstack-neutron-2013.2-1.fc20           f20                   pbrady
$ 


http://fedoraproject.org/wiki/Updates_Policy

Comment 4 Terry Wilson 2013-12-16 19:36:30 UTC
Kashyap: Fedora doesn't use the old SysV init scripts. The way the script works on Fedora is it just goes in and specifically enables that which was already enabled, so things that are disabled shouldn't show up in the list to begin with. From the existing Fedora packaging:

    systemctl list-unit-files|grep '^quantum.*enabled\s*$'| \
      sed -re 's/(\S+).*/systemctl enable \1/
               s/quantum/neutron/g' > %{_localstatedir}/lib/rpm-state/UPGRADE_FROM_QUANTUM

Comment 5 Kashyap Chamarthy 2013-12-18 18:21:42 UTC
(In reply to Terry Wilson from comment #4)
> Kashyap: Fedora doesn't use the old SysV init scripts. The way the script
> works on Fedora is it just goes in and specifically enables that which was
> already enabled, so things that are disabled shouldn't show up in the list
> to begin with. From the existing Fedora packaging:
> 
>     systemctl list-unit-files|grep '^quantum.*enabled\s*$'| \
>       sed -re 's/(\S+).*/systemctl enable \1/
>                s/quantum/neutron/g' >
> %{_localstatedir}/lib/rpm-state/UPGRADE_FROM_QUANTUM

Right! I forgot about the Fedora's systemd stuff for a moment. Thanks for the comment.


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