Comment 2 for bug 1547379

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Fix for:

sudo: ovs-vsctl: command not found

[root@centos7-master ~]#yum -y install wget openssl-devel gcc make python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool

[root@centos7-master ~]# adduser ovs
[root@centos7-master ~]# su - ovs
[ovs@centos7-master ~]$ mkdir -p ~/rpmbuild/SOURCES
[ovs@centos7-master ~]$ wget http://openvswitch.org/releases/openvswitch-2.4.0.tar.gz
[ovs@centos7-master ~]$ cp openvswitch-2.4.0.tar.gz rpmbuild/SOURCES/
[ovs@centos7-master ~]$ tar -xvf openvswitch-2.4.0.tar.gz

[ovs@centos7-master ~]$ sed 's/openvswitch-kmod, //g' openvswitch-2.4.0/rhel/openvswitch.spec > openvswitch-2.4.0/rhel/openvswitch_no_kmod.spec
[ovs@centos7-master ~]$ rpmbuild -bb --nocheck openvswitch-2.4.0/rhel/openvswitch_no_kmod.spec
[ovs@centos7-master ~]$ exit

[root@centos7-master ~]# mkdir /etc/openvswitch
[root@centos7-master ~]# yum localinstall /home/ovs/rpmbuild/RPMS/x86_64/openvswitch-2.4.0-1.x86_64.rpm

[root@centos7-master ~]# semanage fcontext -a -t openvswitch_rw_t "/etc/openvswitch(/.*)?"
libsemanage.dbase_llist_query: could not query record value (No such file or directory).
[root@centos7-master ~]# restorecon -Rv /etc/openvswitch
restorecon reset /etc/openvswitch context unconfined_u:object_r:etc_t:s0->unconfined_u:object_r:openvswitch_rw_t:s0
[root@centos7-master ~]# systemctl start openvswitch.service
[root@centos7-master ~]# systemctl enable openvswitch.service

[root@centos7-master ~]# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 2.4.0
Compiled Feb 19 2016 03:41:32
DB Schema 7.12.1