Hi Terry,

Terry Wilson <twil...@redhat.com> writes:

> On Thu, Aug 11, 2016 at 8:53 PM, Aaron Conole <acon...@bytheb.org> wrote:
>> I've been working on a better solution - it occurred to me that since
>> this is being done for linux-only anyway, I might as well do this with
>> systemd.  I can get almost everything done with no C code changes, thus
>> far.  Once I figure out one last permission bit, I will package it up
>> nicely and ask Flavio and Russell to review
>
> I remember starting out looking for a systemd-only solution to this
> issue and kept running into one roadblock after another. One issue was
> always having a configurable group, since for instance qemu may or may
> not be installed on the system. Another was that systemd didn't seem
> to be honoring the umask when I set it in the service definition, so I
> had to modify the ovs-ctl script to call umask. The other was that
> using umask would also change the perms on things like log files.
> Maybe you'll have better luck, but it really seemed like a code-level
> change was going to be better.

Thanks for your comments, and for the heads up on problems you
encountered.  I'm going to make sure that when I submit, I'll have
accommodated all of these concerns.  I've had plenty of fun with unix
domain sockets and file permissions, for certain definitions of fun. :)

I did some of the things you've mentioned here, as well as some
systemd service changes.  I don't see log-file permission changes you're
describing, but if I encounter anything that looks even remotely like
it's not workable, I'll go back to a c-code solution (I've saved the
patches off somewhere).  I'm not yet ready to publish these changes -
they need to be massaged into a clean series.  But here's the output of
booting up the openvswitch service on fedora 23:

05:20:50 aconole /var$ cat /etc/sysconfig/openvswitch
OPTIONS=""
VHOST_USER_SOCKET_DIRECTORY="vhost-sockets"
VHOST_USER_SOCKET_DIRECTORY_OWNERSHIP=":aconole"
DPDK_ENABLED=true
05:21:08 aconole /var$ ls -lah log/openvswitch/
total 84K
drwxr-xr-x.  2 root root 4.0K Aug 11 20:36 .
drwxr-xr-x. 16 root root 4.0K Aug 12 09:31 ..
-rw-r--r--.  1 root root  12K Aug 12 11:25 ovsdb-server.log
-rw-r--r--.  1 root root  60K Aug 12 11:25 ovs-vswitchd.log
05:21:11 aconole /var$ ls -lah run/openvswitch/
total 8.0K
drwxr-xr-x.  3 root root     200 Aug 12 11:25 .
drwxr-xr-x. 43 root root    1.4K Aug 12 11:25 ..
srwxrwx---.  1 root root       0 Aug 12 11:25 db.sock
srwxrwx---.  1 root root       0 Aug 12 11:25 dpdkbr0.mgmt
srwxrwx---.  1 root root       0 Aug 12 11:25 dpdkbr0.snoop
srwxrwx---.  1 root root       0 Aug 12 11:25 ovsdb-server.18210.ctl
-rw-rw-r--.  1 root root       6 Aug 12 11:25 ovsdb-server.pid
srwxrwx---.  1 root root       0 Aug 12 11:25 ovs-vswitchd.18299.ctl
-rw-rw-r--.  1 root root       6 Aug 12 11:25 ovs-vswitchd.pid
drwxrws---.  2 root aconole   60 Aug 12 11:25 vhost-sockets
05:21:20 aconole /var$ ls -lah run/openvswitch/vhost-sockets/
total 0
drwxrws---. 2 root aconole  60 Aug 12 11:25 .
drwxr-xr-x. 3 root root    200 Aug 12 11:25 ..
srwxrwxr-x. 1 root aconole   0 Aug 12 11:25 dpdk0
05:21:39 aconole /var/log/openvswitch$ systemctl status ovs-vswitchd -l
● ovs-vswitchd.service - Open vSwitch Forwarding Unit
   Loaded: loaded (/usr/lib/systemd/system/ovs-vswitchd.service; static; vendor 
preset: disabled)
   Active: active (running) since Fri 2016-08-12 11:25:11 EDT; 5h 55min ago
  Process: 18264 ExecStart=/usr/share/openvswitch/scripts/ovs-ctl 
--no-ovsdb-server --no-monitor --system-id=random start $OPTIONS (code=exited, 
status=0/SUCCESS)
  Process: 18256 ExecStartPre=/usr/bin/ovs-vsctl --no-wait set Open_vSwitch . 
other-config:vhost-sock-dir=${VHOST_USER_SOCKET_DIRECTORY} (code=exited, 
status=0/SUCCESS)
  Process: 18249 ExecStartPre=/usr/bin/ovs-vsctl --no-wait set Open_vSwitch . 
other-config:dpdk-init=${DPDK_ENABLED} (code=exited, status=0/SUCCESS)
  Process: 18244 ExecStartPre=/bin/chown 
${VHOST_USER_SOCKET_DIRECTORY_OWNERSHIP} 
/var/run/openvswitch/${VHOST_USER_SOCKET_DIRECTORY} (code=exited, 
status=0/SUCCESS)
  Process: 18239 ExecStartPre=/bin/mkdir -m 2770 -p 
/var/run/openvswitch/${VHOST_USER_SOCKET_DIRECTORY} (code=exited, 
status=0/SUCCESS)
 Main PID: 18299 (ovs-vswitchd)
   CGroup: /system.slice/ovs-vswitchd.service
           └─18299 ovs-vswitchd unix:/var/run/openvswitch/db.sock 
-vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir 
--log-file=/var/log/openvswitch/ovs-vswitchd.log 
--pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach

Aug 12 11:25:11 dhcp-25-97.bos.redhat.com ovs-vswitchd[18299]: VHOST_CONFIG: 
vhost-user server: socket created, fd: 34
Aug 12 11:25:11 dhcp-25-97.bos.redhat.com ovs-vswitchd[18299]: VHOST_CONFIG: 
bind to /var/run/openvswitch/vhost-sockets/dpdk0
Aug 12 11:25:11 dhcp-25-97.bos.redhat.com ovs-ctl[18264]: VHOST_CONFIG: bind to 
/var/run/openvswitch/vhost-sockets/dpdk0
Aug 12 11:25:11 dhcp-25-97.bos.redhat.com ovs-ctl[18264]: [  OK  ]
Aug 12 11:25:11 dhcp-25-97.bos.redhat.com ovs-ctl[18264]: Enabling remote OVSDB 
managers [  OK  ]
Aug 12 11:25:11 dhcp-25-97.bos.redhat.com systemd[1]: Started Open vSwitch 
Forwarding Unit.
Aug 12 11:25:41 dhcp-25-97.bos.redhat.com ovs-vswitchd[18299]: VHOST_CONFIG: 
new vhost user connection is 47
Aug 12 11:25:41 dhcp-25-97.bos.redhat.com ovs-vswitchd[18299]: VHOST_CONFIG: 
new device, handle is 0
Aug 12 11:25:43 dhcp-25-97.bos.redhat.com ovs-vswitchd[18299]: VHOST_CONFIG: 
invalid msg size: 2046805816
Aug 12 11:25:43 dhcp-25-97.bos.redhat.com ovs-vswitchd[18299]: VHOST_CONFIG: 
vhost read message failed
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to