[ovs-discuss] systemd ovs-vswitchd starts too early

Benoît benoitne at gmail.com
Sat Jan 9 13:33:35 UTC 2016


Many thanks
I have tried to implement it but was not able to get a stable behavior : 
depending if my server is shutdown -r or poweroff I got different 
behavior...
So I decided to start ovs on a script after my server boots...for now
perhaps it would be good to get something working as expected in the 
future when using systemd

ps : I also realized that systemd-networkd doesn't like the fact that 
some interface has no IP (the interface part of ovs bridge)
for now in systemd-networkd is mandatory to have and IP address or DHCP 
on interface managed by systemd-networkd but in case of openvswith 
sometimes we don't want that..

On 08/01/16 20:31, Guru Shetty wrote:
>
>
>     what do you think it would bring to add this oneshot service as I
>     see it only launch the openvswitch-nonetwork.service?
>
>
> If I remember correctly, fedora split this for the following reasons.
>
>  openvswitch service will start after network. But network will look 
> at ifcfg-* scripts. If one of those scripts has openvswitch device to 
> be configured, it can't start it because openvswitch is not yet started.
>
> So Fedora, added the following:
> https://github.com/openvswitch/ovs/blob/master/rhel/etc_sysconfig_network-scripts_ifup-ovs#L63
>
> What the above does is that it will force start 
> openvswitch-nonetwork.service even before openvswitch.service starts.
>
>
>
>
>     On 01/08/16 16:51, Ian Pilcher wrote:
>>     On 01/08/2016 09:27 AM, Benoît wrote:
>>>     it is using /etc/systemd/network
>>>     and to start ovs :
>>>     /etc/systemd/system/multi-user.target.wants/ovs-vswitchd.service
>>>     [Unit]
>>>     Description    = Open vSwitch Daemon
>>>     Documentation  = man:ovs-vswitchd
>>>     Wants          = network.target
>>>     Before         = network.target
>>>     Requires       = ovsdb-server.service
>>>     After          = ovsdb-server.service
>>>
>>>     [Service]
>>>     ExecStartPre = /sbin/modprobe openvswitch
>>>     PIDFile = /run/openvswitch/ovs-vswitchd.pid
>>>     ExecStart = /usr/sbin/ovs-vswitchd
>>>     --pidfile=/run/openvswitch/ovs-vswitchd.pid
>>
>>     It looks like Arch hasn't split the Open vSwitch service into
>>     pre- and
>>     post-network stages.  Here's what Fedora does:
>>
>>     $ cat openvswitch.service
>>     [Unit]
>>     Description=Open vSwitch
>>     After=syslog.target network.target openvswitch-nonetwork.service
>>     Requires=openvswitch-nonetwork.service
>>
>>     [Service]
>>     Type=oneshot
>>     ExecStart=/bin/true
>>     ExecStop=/bin/true
>>     RemainAfterExit=yes
>>
>>     [Install]
>>     WantedBy=multi-user.target
>>
>>
>>     $ cat openvswitch-nonetwork.service
>>     [Unit]
>>     Description=Open vSwitch Internal Unit
>>     After=syslog.target
>>     PartOf=openvswitch.service
>>     Wants=openvswitch.service
>>
>>     [Service]
>>     Type=oneshot
>>     RemainAfterExit=yes
>>     EnvironmentFile=-/etc/sysconfig/openvswitch
>>     ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \
>>               --system-id=random $OPTIONS
>>     ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop
>>     RuntimeDirectory=openvswitch
>>     RuntimeDirectoryMode=0755
>>
>
>
>     _______________________________________________
>     discuss mailing list
>     discuss at openvswitch.org <mailto:discuss at openvswitch.org>
>     http://openvswitch.org/mailman/listinfo/discuss
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20160109/a1c0d6f4/attachment-0002.html>


More information about the discuss mailing list