diff mbox series

[ovs-dev,v2] ovs-ctl: Allow recording hostname separately

Message ID 20210225152816.3819671-1-frode.nordahl@canonical.com
State Accepted
Headers show
Series [ovs-dev,v2] ovs-ctl: Allow recording hostname separately | expand

Commit Message

Frode Nordahl Feb. 25, 2021, 3:28 p.m. UTC
ovs-ctl determines the system FQDN or hostname and records it in
the `external-ids:hostname` field of the `Open-vSwitch` table on
system startup if it is not already set.

This value may be consumed by downstream software and having it
unset or set to a incorrect value could lead to erratic behavior
of a system.

When a system is configured to use an Open vSwitch controlled
datapath as its only network connection, the current ordering of
events would always record a unreliable hostname.

To tackle this problem this patchs adds an optional argument that
allows starting Open vSwitch without recording the hostname in
the database as well as a new ctl command to record the hostname
separately. This command can be called by the system startup
scripts when the system is ready to collect and record this
information.

Reported-At: https://bugs.launchpad.net/bugs/1915829
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
---
 utilities/ovs-ctl.in | 41 +++++++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 14 deletions(-)

Comments

Ilya Maximets March 1, 2021, 8:26 p.m. UTC | #1
On 2/25/21 4:28 PM, Frode Nordahl wrote:
> ovs-ctl determines the system FQDN or hostname and records it in
> the `external-ids:hostname` field of the `Open-vSwitch` table on
> system startup if it is not already set.
> 
> This value may be consumed by downstream software and having it
> unset or set to a incorrect value could lead to erratic behavior
> of a system.
> 
> When a system is configured to use an Open vSwitch controlled
> datapath as its only network connection, the current ordering of
> events would always record a unreliable hostname.
> 
> To tackle this problem this patchs adds an optional argument that
> allows starting Open vSwitch without recording the hostname in
> the database as well as a new ctl command to record the hostname
> separately. This command can be called by the system startup
> scripts when the system is ready to collect and record this
> information.
> 
> Reported-At: https://bugs.launchpad.net/bugs/1915829
> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
> ---
>  utilities/ovs-ctl.in | 41 +++++++++++++++++++++++++++--------------
>  1 file changed, 27 insertions(+), 14 deletions(-)

Thanks!
I added a note to the NEWS file and applied to master.

We may consider backports down to 2.13 LTS.  Let me know
if it's needed.

Best regards, Ilya Maximets.
Frode Nordahl March 2, 2021, 5:52 a.m. UTC | #2
On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 2/25/21 4:28 PM, Frode Nordahl wrote:
> > ovs-ctl determines the system FQDN or hostname and records it in
> > the `external-ids:hostname` field of the `Open-vSwitch` table on
> > system startup if it is not already set.
> >
> > This value may be consumed by downstream software and having it
> > unset or set to a incorrect value could lead to erratic behavior
> > of a system.
> >
> > When a system is configured to use an Open vSwitch controlled
> > datapath as its only network connection, the current ordering of
> > events would always record a unreliable hostname.
> >
> > To tackle this problem this patchs adds an optional argument that
> > allows starting Open vSwitch without recording the hostname in
> > the database as well as a new ctl command to record the hostname
> > separately. This command can be called by the system startup
> > scripts when the system is ready to collect and record this
> > information.
> >
> > Reported-At: https://bugs.launchpad.net/bugs/1915829
> > Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
> > ---
> >  utilities/ovs-ctl.in | 41 +++++++++++++++++++++++++++--------------
> >  1 file changed, 27 insertions(+), 14 deletions(-)
>
> Thanks!
> I added a note to the NEWS file and applied to master.

Excellent, thank you for review and merge!

> We may consider backports down to 2.13 LTS.  Let me know
> if it's needed.

We will consume this at 2.13 and onwards, so a backport all the way to
2.13 LTS would really be helpful.
Ilya Maximets March 2, 2021, 10:42 a.m. UTC | #3
On 3/2/21 6:52 AM, Frode Nordahl wrote:
> On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>>
>> On 2/25/21 4:28 PM, Frode Nordahl wrote:
>>> ovs-ctl determines the system FQDN or hostname and records it in
>>> the `external-ids:hostname` field of the `Open-vSwitch` table on
>>> system startup if it is not already set.
>>>
>>> This value may be consumed by downstream software and having it
>>> unset or set to a incorrect value could lead to erratic behavior
>>> of a system.
>>>
>>> When a system is configured to use an Open vSwitch controlled
>>> datapath as its only network connection, the current ordering of
>>> events would always record a unreliable hostname.
>>>
>>> To tackle this problem this patchs adds an optional argument that
>>> allows starting Open vSwitch without recording the hostname in
>>> the database as well as a new ctl command to record the hostname
>>> separately. This command can be called by the system startup
>>> scripts when the system is ready to collect and record this
>>> information.
>>>
>>> Reported-At: https://bugs.launchpad.net/bugs/1915829
>>> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
>>> ---
>>>  utilities/ovs-ctl.in | 41 +++++++++++++++++++++++++++--------------
>>>  1 file changed, 27 insertions(+), 14 deletions(-)
>>
>> Thanks!
>> I added a note to the NEWS file and applied to master.
> 
> Excellent, thank you for review and merge!
> 
>> We may consider backports down to 2.13 LTS.  Let me know
>> if it's needed.
> 
> We will consume this at 2.13 and onwards, so a backport all the way to
> 2.13 LTS would really be helpful.
> 

Done.
aginwala Aug. 31, 2021, 6:01 p.m. UTC | #4
Hi:

Thanks for this improvement. As per our recent tests with ovs 2.16 with
5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname as
required in the systemctl params.
Because of that debian installation of ovs always complaints

Setting up openvswitch-switch (2.16.0-1) ...
insserv: warning: script 'iproutepolicy' missing LSB tags and overrides
Failed to restart openvswitch-switch.service: Unit
ovs-record-hostname.service not found.
invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
* openvswitch-switch.service - LSB: Open vSwitch switch
     Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
     Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h 24min ago
       Docs: man:systemd-sysv-generator(8)

Main PID: 5960 (code=exited, status=0/SUCCESS)

dpkg: error processing package openvswitch-switch (--install):
 installed openvswitch-switch package post-installation script
subprocess returned error exit status 1

Installation is ok as dpkg:error shows confusion
dpkg -l | grep openv

Can be also seen on restart if vswitchd fails as debain install
systemctl restart openvswitch-switch.service
Failed to restart openvswitch-switch.service: Unit
ovs-record-hostname.service not found.

With ovs-ctl things works as expected.
Temp fix if we want to skip ovs-host-record for now is.

rm /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
systemctl daemon-reload


I saw upstream ubuntu does add ovs-record.service for debian packaging
https://code.launchpad.net/~fnordahl/ubuntu/+source/openvswitch/+git/openvswitch/+merge/398174



Seems it makes reasonable to port ovs-record-hostname for ovs debian
packaging too to avoid error for 2.16.0 and master ovs branch to avoid
systemctl issues.

Please advice.



On Tue, Mar 2, 2021 at 2:42 AM Ilya Maximets <i.maximets@ovn.org> wrote:

> On 3/2/21 6:52 AM, Frode Nordahl wrote:
> > On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org> wrote:
> >>
> >> On 2/25/21 4:28 PM, Frode Nordahl wrote:
> >>> ovs-ctl determines the system FQDN or hostname and records it in
> >>> the `external-ids:hostname` field of the `Open-vSwitch` table on
> >>> system startup if it is not already set.
> >>>
> >>> This value may be consumed by downstream software and having it
> >>> unset or set to a incorrect value could lead to erratic behavior
> >>> of a system.
> >>>
> >>> When a system is configured to use an Open vSwitch controlled
> >>> datapath as its only network connection, the current ordering of
> >>> events would always record a unreliable hostname.
> >>>
> >>> To tackle this problem this patchs adds an optional argument that
> >>> allows starting Open vSwitch without recording the hostname in
> >>> the database as well as a new ctl command to record the hostname
> >>> separately. This command can be called by the system startup
> >>> scripts when the system is ready to collect and record this
> >>> information.
> >>>
> >>> Reported-At: https://bugs.launchpad.net/bugs/1915829
> >>> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
> >>> ---
> >>>  utilities/ovs-ctl.in | 41 +++++++++++++++++++++++++++--------------
> >>>  1 file changed, 27 insertions(+), 14 deletions(-)
> >>
> >> Thanks!
> >> I added a note to the NEWS file and applied to master.
> >
> > Excellent, thank you for review and merge!
> >
> >> We may consider backports down to 2.13 LTS.  Let me know
> >> if it's needed.
> >
> > We will consume this at 2.13 and onwards, so a backport all the way to
> > 2.13 LTS would really be helpful.
> >
>
> Done.
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Frode Nordahl Aug. 31, 2021, 6:19 p.m. UTC | #5
On Tue, Aug 31, 2021 at 8:01 PM aginwala <aginwala@asu.edu> wrote:
>
> Hi:
>
> Thanks for this improvement. As per our recent tests with ovs 2.16 with 5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname as required in the systemctl params.
> Because of that debian installation of ovs always complaints
>
> Setting up openvswitch-switch (2.16.0-1) ...
> insserv: warning: script 'iproutepolicy' missing LSB tags and overrides
> Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service not found.
> invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
> * openvswitch-switch.service - LSB: Open vSwitch switch
>      Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
>      Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h 24min ago
>        Docs: man:systemd-sysv-generator(8)
>
> Main PID: 5960 (code=exited, status=0/SUCCESS)
>
> dpkg: error processing package openvswitch-switch (--install):
>  installed openvswitch-switch package post-installation script subprocess returned error exit status 1
>
> Installation is ok as dpkg:error shows confusion
> dpkg -l | grep openv
>
> Can be also seen on restart if vswitchd fails as debain install
> systemctl restart openvswitch-switch.service
> Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service not found.
>
> With ovs-ctl things works as expected.
> Temp fix if we want to skip ovs-host-record for now is.
>
> rm /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
> systemctl daemon-reload
>
>
> I saw upstream ubuntu does add ovs-record.service for debian packaging https://code.launchpad.net/~fnordahl/ubuntu/+source/openvswitch/+git/openvswitch/+merge/398174
>
>
> Seems it makes reasonable to port ovs-record-hostname for ovs debian packaging too to avoid error for 2.16.0 and master ovs branch to avoid systemctl issues.
>
> Please advice.

Thank you for reaching out. The change made to the Open vSwitch
repository itself for the ovn-ctl script was of an optional nature and
is only opted into by those who want to use it. As you have found we
do make use of this in Ubuntu, here we provide real systemd service
files, including one for the separate recording of hostname, and do
not rely on the systemd-sysv compatibility layer.

I am not sure how the package you are looking at here came into this
state, it is almost as if someone halfway enabled the feature? What is
the source for the package you are displaying here?
aginwala Aug. 31, 2021, 6:28 p.m. UTC | #6
On Tue, Aug 31, 2021 at 11:20 AM Frode Nordahl <frode.nordahl@canonical.com>
wrote:

> On Tue, Aug 31, 2021 at 8:01 PM aginwala <aginwala@asu.edu> wrote:
> >
> > Hi:
> >
> > Thanks for this improvement. As per our recent tests with ovs 2.16 with
> 5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname as
> required in the systemctl params.
> > Because of that debian installation of ovs always complaints
> >
> > Setting up openvswitch-switch (2.16.0-1) ...
> > insserv: warning: script 'iproutepolicy' missing LSB tags and overrides
> > Failed to restart openvswitch-switch.service: Unit
> ovs-record-hostname.service not found.
> > invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
> > * openvswitch-switch.service - LSB: Open vSwitch switch
> >      Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
> >      Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h 24min
> ago
> >        Docs: man:systemd-sysv-generator(8)
> >
> > Main PID: 5960 (code=exited, status=0/SUCCESS)
> >
> > dpkg: error processing package openvswitch-switch (--install):
> >  installed openvswitch-switch package post-installation script
> subprocess returned error exit status 1
> >
> > Installation is ok as dpkg:error shows confusion
> > dpkg -l | grep openv
> >
> > Can be also seen on restart if vswitchd fails as debain install
> > systemctl restart openvswitch-switch.service
> > Failed to restart openvswitch-switch.service: Unit
> ovs-record-hostname.service not found.
> >
> > With ovs-ctl things works as expected.
> > Temp fix if we want to skip ovs-host-record for now is.
> >
> > rm
> /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
> > systemctl daemon-reload
> >
> >
> > I saw upstream ubuntu does add ovs-record.service for debian packaging
> https://urldefense.com/v3/__https://code.launchpad.net/*fnordahl/ubuntu/*source/openvswitch/*git/openvswitch/*merge/398174__;fisrKw!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVCx3SwlA$
> >
> >
> > Seems it makes reasonable to port ovs-record-hostname for ovs debian
> packaging too to avoid error for 2.16.0 and master ovs branch to avoid
> systemctl issues.
> >
> > Please advice.
>
> Thank you for reaching out. The change made to the Open vSwitch
> repository itself for the ovn-ctl script was of an optional nature and
> is only opted into by those who want to use it. As you have found we
> do make use of this in Ubuntu, here we provide real systemd service
> files, including one for the separate recording of hostname, and do
> not rely on the systemd-sysv compatibility layer.
>
> I am not sure how the package you are looking at here came into this
> state, it is almost as if someone halfway enabled the feature? What is
> the source for the package you are displaying here?
>
> https://github.com/openvswitch/ovs/tree/v2.16.0 and building with debian
build on kernel 5.4-80

So, on ubuntu itself ovs-record-hostname can be optional for openvswitch vs
being set as required on systemctl settings in 5.4* kernel.
or
add ovs-record-hostname.service in
https://github.com/openvswitch/ovs/tree/v2.16.0/debian so that debain
compilation will set that up.
That's what I can read from the current code so far.

> --
> Frode Nordahl
>
> >
> >
> >
> > On Tue, Mar 2, 2021 at 2:42 AM Ilya Maximets <i.maximets@ovn.org> wrote:
> >>
> >> On 3/2/21 6:52 AM, Frode Nordahl wrote:
> >> > On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org>
> wrote:
> >> >>
> >> >> On 2/25/21 4:28 PM, Frode Nordahl wrote:
> >> >>> ovs-ctl determines the system FQDN or hostname and records it in
> >> >>> the `external-ids:hostname` field of the `Open-vSwitch` table on
> >> >>> system startup if it is not already set.
> >> >>>
> >> >>> This value may be consumed by downstream software and having it
> >> >>> unset or set to a incorrect value could lead to erratic behavior
> >> >>> of a system.
> >> >>>
> >> >>> When a system is configured to use an Open vSwitch controlled
> >> >>> datapath as its only network connection, the current ordering of
> >> >>> events would always record a unreliable hostname.
> >> >>>
> >> >>> To tackle this problem this patchs adds an optional argument that
> >> >>> allows starting Open vSwitch without recording the hostname in
> >> >>> the database as well as a new ctl command to record the hostname
> >> >>> separately. This command can be called by the system startup
> >> >>> scripts when the system is ready to collect and record this
> >> >>> information.
> >> >>>
> >> >>> Reported-At:
> https://urldefense.com/v3/__https://bugs.launchpad.net/bugs/1915829__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxV8PBtinU$
> >> >>> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
> >> >>> ---
> >> >>>  utilities/ovs-ctl.in | 41
> +++++++++++++++++++++++++++--------------
> >> >>>  1 file changed, 27 insertions(+), 14 deletions(-)
> >> >>
> >> >> Thanks!
> >> >> I added a note to the NEWS file and applied to master.
> >> >
> >> > Excellent, thank you for review and merge!
> >> >
> >> >> We may consider backports down to 2.13 LTS.  Let me know
> >> >> if it's needed.
> >> >
> >> > We will consume this at 2.13 and onwards, so a backport all the way to
> >> > 2.13 LTS would really be helpful.
> >> >
> >>
> >> Done.
> >> _______________________________________________
> >> dev mailing list
> >> dev@openvswitch.org
> >>
> https://urldefense.com/v3/__https://mail.openvswitch.org/mailman/listinfo/ovs-dev__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVFbGw-DU$
>
Frode Nordahl Sept. 1, 2021, 6:26 a.m. UTC | #7
On Tue, Aug 31, 2021 at 8:28 PM aginwala <aginwala@asu.edu> wrote:
>
>
>
> On Tue, Aug 31, 2021 at 11:20 AM Frode Nordahl <frode.nordahl@canonical.com> wrote:
>>
>> On Tue, Aug 31, 2021 at 8:01 PM aginwala <aginwala@asu.edu> wrote:
>> >
>> > Hi:
>> >
>> > Thanks for this improvement. As per our recent tests with ovs 2.16 with 5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname as required in the systemctl params.
>> > Because of that debian installation of ovs always complaints
>> >
>> > Setting up openvswitch-switch (2.16.0-1) ...
>> > insserv: warning: script 'iproutepolicy' missing LSB tags and overrides
>> > Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service not found.
>> > invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
>> > * openvswitch-switch.service - LSB: Open vSwitch switch
>> >      Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
>> >      Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h 24min ago
>> >        Docs: man:systemd-sysv-generator(8)
>> >
>> > Main PID: 5960 (code=exited, status=0/SUCCESS)
>> >
>> > dpkg: error processing package openvswitch-switch (--install):
>> >  installed openvswitch-switch package post-installation script subprocess returned error exit status 1
>> >
>> > Installation is ok as dpkg:error shows confusion
>> > dpkg -l | grep openv
>> >
>> > Can be also seen on restart if vswitchd fails as debain install
>> > systemctl restart openvswitch-switch.service
>> > Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service not found.
>> >
>> > With ovs-ctl things works as expected.
>> > Temp fix if we want to skip ovs-host-record for now is.
>> >
>> > rm /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
>> > systemctl daemon-reload
>> >
>> >
>> > I saw upstream ubuntu does add ovs-record.service for debian packaging https://urldefense.com/v3/__https://code.launchpad.net/*fnordahl/ubuntu/*source/openvswitch/*git/openvswitch/*merge/398174__;fisrKw!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVCx3SwlA$
>> >
>> >
>> > Seems it makes reasonable to port ovs-record-hostname for ovs debian packaging too to avoid error for 2.16.0 and master ovs branch to avoid systemctl issues.
>> >
>> > Please advice.
>>
>> Thank you for reaching out. The change made to the Open vSwitch
>> repository itself for the ovn-ctl script was of an optional nature and
>> is only opted into by those who want to use it. As you have found we
>> do make use of this in Ubuntu, here we provide real systemd service
>> files, including one for the separate recording of hostname, and do
>> not rely on the systemd-sysv compatibility layer.
>>
>> I am not sure how the package you are looking at here came into this
>> state, it is almost as if someone halfway enabled the feature? What is
>> the source for the package you are displaying here?
>>
> https://github.com/openvswitch/ovs/tree/v2.16.0 and building with debian build on kernel 5.4-80
>
> So, on ubuntu itself ovs-record-hostname can be optional for openvswitch vs being set as required on systemctl settings in 5.4* kernel.
> or
> add ovs-record-hostname.service in https://github.com/openvswitch/ovs/tree/v2.16.0/debian so that debain compilation will set that up.
> That's what I can read from the current code so far.

So I built debs from the currently tagged v2.16.0 sources and
installed them on a clean system without any prior installation of
Open vSwitch and I see no mention of a ovs-record-hostname.service and
I have no issues starting or restarting the
openvswitch-switch.service.  This service is also not mentioned in the
debian package recipe in the OVS repository.

Could the files you see in /etc/systemd be left over from a different
package installation? Or am I misunderstanding the problem?
aginwala Sept. 1, 2021, 7:26 a.m. UTC | #8
On Tue, Aug 31, 2021 at 11:26 PM Frode Nordahl <frode.nordahl@canonical.com>
wrote:

> On Tue, Aug 31, 2021 at 8:28 PM aginwala <aginwala@asu.edu> wrote:
> >
> >
> >
> > On Tue, Aug 31, 2021 at 11:20 AM Frode Nordahl <
> frode.nordahl@canonical.com> wrote:
> >>
> >> On Tue, Aug 31, 2021 at 8:01 PM aginwala <aginwala@asu.edu> wrote:
> >> >
> >> > Hi:
> >> >
> >> > Thanks for this improvement. As per our recent tests with ovs 2.16
> with 5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname
> as required in the systemctl params.
> >> > Because of that debian installation of ovs always complaints
> >> >
> >> > Setting up openvswitch-switch (2.16.0-1) ...
> >> > insserv: warning: script 'iproutepolicy' missing LSB tags and
> overrides
> >> > Failed to restart openvswitch-switch.service: Unit
> ovs-record-hostname.service not found.
> >> > invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
> >> > * openvswitch-switch.service - LSB: Open vSwitch switch
> >> >      Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
> >> >      Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h
> 24min ago
> >> >        Docs: man:systemd-sysv-generator(8)
> >> >
> >> > Main PID: 5960 (code=exited, status=0/SUCCESS)
> >> >
> >> > dpkg: error processing package openvswitch-switch (--install):
> >> >  installed openvswitch-switch package post-installation script
> subprocess returned error exit status 1
> >> >
> >> > Installation is ok as dpkg:error shows confusion
> >> > dpkg -l | grep openv
> >> >
> >> > Can be also seen on restart if vswitchd fails as debain install
> >> > systemctl restart openvswitch-switch.service
> >> > Failed to restart openvswitch-switch.service: Unit
> ovs-record-hostname.service not found.
> >> >
> >> > With ovs-ctl things works as expected.
> >> > Temp fix if we want to skip ovs-host-record for now is.
> >> >
> >> > rm
> /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
> >> > systemctl daemon-reload
> >> >
> >> >
> >> > I saw upstream ubuntu does add ovs-record.service for debian
> packaging
> https://urldefense.com/v3/__https://code.launchpad.net/*fnordahl/ubuntu/*source/openvswitch/*git/openvswitch/*merge/398174__;fisrKw!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVCx3SwlA$
> >> >
> >> >
> >> > Seems it makes reasonable to port ovs-record-hostname for ovs debian
> packaging too to avoid error for 2.16.0 and master ovs branch to avoid
> systemctl issues.
> >> >
> >> > Please advice.
> >>
> >> Thank you for reaching out. The change made to the Open vSwitch
> >> repository itself for the ovn-ctl script was of an optional nature and
> >> is only opted into by those who want to use it. As you have found we
> >> do make use of this in Ubuntu, here we provide real systemd service
> >> files, including one for the separate recording of hostname, and do
> >> not rely on the systemd-sysv compatibility layer.
> >>
> >> I am not sure how the package you are looking at here came into this
> >> state, it is almost as if someone halfway enabled the feature? What is
> >> the source for the package you are displaying here?
> >>
> >
> https://urldefense.com/v3/__https://github.com/openvswitch/ovs/tree/v2.16.0__;!!IKRxdwAv5BmarQ!OovT7gtV1b9NvkRLizdRIY7Gviy8uckgpLx8-TfmSkPQp6Cr_GsaUsh8V6UvX08$
> and building with debian build on kernel 5.4-80
> >
> > So, on ubuntu itself ovs-record-hostname can be optional for openvswitch
> vs being set as required on systemctl settings in 5.4* kernel.
> > or
> > add ovs-record-hostname.service in
> https://urldefense.com/v3/__https://github.com/openvswitch/ovs/tree/v2.16.0/debian__;!!IKRxdwAv5BmarQ!OovT7gtV1b9NvkRLizdRIY7Gviy8uckgpLx8-TfmSkPQp6Cr_GsaUsh8L1zplWw$
> so that debain compilation will set that up.
> > That's what I can read from the current code so far.
>
> So I built debs from the currently tagged v2.16.0 sources and
> installed them on a clean system without any prior installation of
> Open vSwitch and I see no mention of a ovs-record-hostname.service and
> I have no issues starting or restarting the
> openvswitch-switch.service.  This service is also not mentioned in the
> debian package recipe in the OVS repository.
>
> Could the files you see in /etc/systemd be left over from a different
> package installation? Or am I misunderstanding the problem?
>
> Hey thanks for trying out. I should have clarified earlier(my bad); the
issue happens on kernel upgrade ; from older 4.* to 5.4.0-80  to
ubuntu20.04(focal) where our kernel builds pulls openvswitch default debs
https://launchpad.net/ubuntu/+source/openvswitch/2.13.3-0ubuntu0.20.04.1
that has ovs-record-hostname set in systemd. However, the newly generated
ovs debian that we have on tag v2.16.0 from ovs source  doesn't have it.
Since kernel upgrade touches openvswitch systemd settings, vswitchd with
2.16.0 complaints/fails. Seems it impacts the newer ubuntu versions. So not
sure if we can improvise the openvswitch debains on ubuntu20 and onwards
release as it seems to be imposed from canonical for ubuntu20 releases. Not
sure if we should backport the same patch in ovs repo can help avoid
systemd compatibility issues.

> --
> Frode Nordahl
>
> >>
> >> --
> >> Frode Nordahl
> >>
> >> >
> >> >
> >> >
> >> > On Tue, Mar 2, 2021 at 2:42 AM Ilya Maximets <i.maximets@ovn.org>
> wrote:
> >> >>
> >> >> On 3/2/21 6:52 AM, Frode Nordahl wrote:
> >> >> > On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org>
> wrote:
> >> >> >>
> >> >> >> On 2/25/21 4:28 PM, Frode Nordahl wrote:
> >> >> >>> ovs-ctl determines the system FQDN or hostname and records it in
> >> >> >>> the `external-ids:hostname` field of the `Open-vSwitch` table on
> >> >> >>> system startup if it is not already set.
> >> >> >>>
> >> >> >>> This value may be consumed by downstream software and having it
> >> >> >>> unset or set to a incorrect value could lead to erratic behavior
> >> >> >>> of a system.
> >> >> >>>
> >> >> >>> When a system is configured to use an Open vSwitch controlled
> >> >> >>> datapath as its only network connection, the current ordering of
> >> >> >>> events would always record a unreliable hostname.
> >> >> >>>
> >> >> >>> To tackle this problem this patchs adds an optional argument that
> >> >> >>> allows starting Open vSwitch without recording the hostname in
> >> >> >>> the database as well as a new ctl command to record the hostname
> >> >> >>> separately. This command can be called by the system startup
> >> >> >>> scripts when the system is ready to collect and record this
> >> >> >>> information.
> >> >> >>>
> >> >> >>> Reported-At:
> https://urldefense.com/v3/__https://bugs.launchpad.net/bugs/1915829__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxV8PBtinU$
> >> >> >>> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
> >> >> >>> ---
> >> >> >>>  utilities/ovs-ctl.in | 41
> +++++++++++++++++++++++++++--------------
> >> >> >>>  1 file changed, 27 insertions(+), 14 deletions(-)
> >> >> >>
> >> >> >> Thanks!
> >> >> >> I added a note to the NEWS file and applied to master.
> >> >> >
> >> >> > Excellent, thank you for review and merge!
> >> >> >
> >> >> >> We may consider backports down to 2.13 LTS.  Let me know
> >> >> >> if it's needed.
> >> >> >
> >> >> > We will consume this at 2.13 and onwards, so a backport all the
> way to
> >> >> > 2.13 LTS would really be helpful.
> >> >> >
> >> >>
> >> >> Done.
> >> >> _______________________________________________
> >> >> dev mailing list
> >> >> dev@openvswitch.org
> >> >>
> https://urldefense.com/v3/__https://mail.openvswitch.org/mailman/listinfo/ovs-dev__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVFbGw-DU$
>
aginwala Sept. 1, 2021, 11:25 p.m. UTC | #9
On Wed, Sep 1, 2021 at 12:26 AM aginwala <aginwala@asu.edu> wrote:

>
>
> On Tue, Aug 31, 2021 at 11:26 PM Frode Nordahl <
> frode.nordahl@canonical.com> wrote:
>
>> On Tue, Aug 31, 2021 at 8:28 PM aginwala <aginwala@asu.edu> wrote:
>> >
>> >
>> >
>> > On Tue, Aug 31, 2021 at 11:20 AM Frode Nordahl <
>> frode.nordahl@canonical.com> wrote:
>> >>
>> >> On Tue, Aug 31, 2021 at 8:01 PM aginwala <aginwala@asu.edu> wrote:
>> >> >
>> >> > Hi:
>> >> >
>> >> > Thanks for this improvement. As per our recent tests with ovs 2.16
>> with 5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname
>> as required in the systemctl params.
>> >> > Because of that debian installation of ovs always complaints
>> >> >
>> >> > Setting up openvswitch-switch (2.16.0-1) ...
>> >> > insserv: warning: script 'iproutepolicy' missing LSB tags and
>> overrides
>> >> > Failed to restart openvswitch-switch.service: Unit
>> ovs-record-hostname.service not found.
>> >> > invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
>> >> > * openvswitch-switch.service - LSB: Open vSwitch switch
>> >> >      Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
>> >> >      Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h
>> 24min ago
>> >> >        Docs: man:systemd-sysv-generator(8)
>> >> >
>> >> > Main PID: 5960 (code=exited, status=0/SUCCESS)
>> >> >
>> >> > dpkg: error processing package openvswitch-switch (--install):
>> >> >  installed openvswitch-switch package post-installation script
>> subprocess returned error exit status 1
>> >> >
>> >> > Installation is ok as dpkg:error shows confusion
>> >> > dpkg -l | grep openv
>> >> >
>> >> > Can be also seen on restart if vswitchd fails as debain install
>> >> > systemctl restart openvswitch-switch.service
>> >> > Failed to restart openvswitch-switch.service: Unit
>> ovs-record-hostname.service not found.
>> >> >
>> >> > With ovs-ctl things works as expected.
>> >> > Temp fix if we want to skip ovs-host-record for now is.
>> >> >
>> >> > rm
>> /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
>> >> > systemctl daemon-reload
>> >> >
>> >> >
>> >> > I saw upstream ubuntu does add ovs-record.service for debian
>> packaging
>> https://urldefense.com/v3/__https://code.launchpad.net/*fnordahl/ubuntu/*source/openvswitch/*git/openvswitch/*merge/398174__;fisrKw!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVCx3SwlA$
>> >> >
>> >> >
>> >> > Seems it makes reasonable to port ovs-record-hostname for ovs debian
>> packaging too to avoid error for 2.16.0 and master ovs branch to avoid
>> systemctl issues.
>> >> >
>> >> > Please advice.
>> >>
>> >> Thank you for reaching out. The change made to the Open vSwitch
>> >> repository itself for the ovn-ctl script was of an optional nature and
>> >> is only opted into by those who want to use it. As you have found we
>> >> do make use of this in Ubuntu, here we provide real systemd service
>> >> files, including one for the separate recording of hostname, and do
>> >> not rely on the systemd-sysv compatibility layer.
>> >>
>> >> I am not sure how the package you are looking at here came into this
>> >> state, it is almost as if someone halfway enabled the feature? What is
>> >> the source for the package you are displaying here?
>> >>
>> >
>> https://urldefense.com/v3/__https://github.com/openvswitch/ovs/tree/v2.16.0__;!!IKRxdwAv5BmarQ!OovT7gtV1b9NvkRLizdRIY7Gviy8uckgpLx8-TfmSkPQp6Cr_GsaUsh8V6UvX08$
>> and building with debian build on kernel 5.4-80
>> >
>> > So, on ubuntu itself ovs-record-hostname can be optional for
>> openvswitch vs being set as required on systemctl settings in 5.4* kernel.
>> > or
>> > add ovs-record-hostname.service in
>> https://urldefense.com/v3/__https://github.com/openvswitch/ovs/tree/v2.16.0/debian__;!!IKRxdwAv5BmarQ!OovT7gtV1b9NvkRLizdRIY7Gviy8uckgpLx8-TfmSkPQp6Cr_GsaUsh8L1zplWw$
>> so that debain compilation will set that up.
>> > That's what I can read from the current code so far.
>>
>> So I built debs from the currently tagged v2.16.0 sources and
>> installed them on a clean system without any prior installation of
>> Open vSwitch and I see no mention of a ovs-record-hostname.service and
>> I have no issues starting or restarting the
>> openvswitch-switch.service.  This service is also not mentioned in the
>> debian package recipe in the OVS repository.
>>
>> Could the files you see in /etc/systemd be left over from a different
>> package installation? Or am I misunderstanding the problem?
>>
>> Hey thanks for trying out. I should have clarified earlier(my bad); the
> issue happens on kernel upgrade ; from older 4.* to 5.4.0-80  to
> ubuntu20.04(focal) where our kernel builds pulls openvswitch default debs
> https://launchpad.net/ubuntu/+source/openvswitch/2.13.3-0ubuntu0.20.04.1
> that has ovs-record-hostname set in systemd. However, the newly generated
> ovs debian that we have on tag v2.16.0 from ovs source  doesn't have it.
> Since kernel upgrade touches openvswitch systemd settings, vswitchd with
> 2.16.0 complaints/fails. Seems it impacts the newer ubuntu versions. So not
> sure if we can improvise the openvswitch debains on ubuntu20 and onwards
> release as it seems to be imposed from canonical for ubuntu20 releases. Not
> sure if we should backport the same patch in ovs repo can help avoid
> systemd compatibility issues.
>
For now we have fixed on our side by skipping installation of  ubuntu
openvswitch-switch from canonnical while upgrading kernel using apt-mark
hold openvswitch-switch to avoid ovs-record-hostname.service being added in
sysctl

dpkg-deb -c ./openvswitch-switch_2.13.3-0ubuntu0.20.04.1_amd64.deb |
grep service
-rw-r--r-- root/root       418 2021-03-17 02:48
./lib/systemd/system/openvswitch-switch.service
-rw-r--r-- root/root       540 2021-03-17 02:48
./lib/systemd/system/ovs-record-hostname.service
-rw-r--r-- root/root       934 2021-03-17 02:48
./lib/systemd/system/ovs-vswitchd.service

-rw-r--r-- root/root 774 2021-03-18 02:18
./lib/systemd/system/ovsdb-server.service



> --
>> Frode Nordahl
>>
>> >>
>> >> --
>> >> Frode Nordahl
>> >>
>> >> >
>> >> >
>> >> >
>> >> > On Tue, Mar 2, 2021 at 2:42 AM Ilya Maximets <i.maximets@ovn.org>
>> wrote:
>> >> >>
>> >> >> On 3/2/21 6:52 AM, Frode Nordahl wrote:
>> >> >> > On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org>
>> wrote:
>> >> >> >>
>> >> >> >> On 2/25/21 4:28 PM, Frode Nordahl wrote:
>> >> >> >>> ovs-ctl determines the system FQDN or hostname and records it in
>> >> >> >>> the `external-ids:hostname` field of the `Open-vSwitch` table on
>> >> >> >>> system startup if it is not already set.
>> >> >> >>>
>> >> >> >>> This value may be consumed by downstream software and having it
>> >> >> >>> unset or set to a incorrect value could lead to erratic behavior
>> >> >> >>> of a system.
>> >> >> >>>
>> >> >> >>> When a system is configured to use an Open vSwitch controlled
>> >> >> >>> datapath as its only network connection, the current ordering of
>> >> >> >>> events would always record a unreliable hostname.
>> >> >> >>>
>> >> >> >>> To tackle this problem this patchs adds an optional argument
>> that
>> >> >> >>> allows starting Open vSwitch without recording the hostname in
>> >> >> >>> the database as well as a new ctl command to record the hostname
>> >> >> >>> separately. This command can be called by the system startup
>> >> >> >>> scripts when the system is ready to collect and record this
>> >> >> >>> information.
>> >> >> >>>
>> >> >> >>> Reported-At:
>> https://urldefense.com/v3/__https://bugs.launchpad.net/bugs/1915829__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxV8PBtinU$
>> >> >> >>> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
>> >> >> >>> ---
>> >> >> >>>  utilities/ovs-ctl.in | 41
>> +++++++++++++++++++++++++++--------------
>> >> >> >>>  1 file changed, 27 insertions(+), 14 deletions(-)
>> >> >> >>
>> >> >> >> Thanks!
>> >> >> >> I added a note to the NEWS file and applied to master.
>> >> >> >
>> >> >> > Excellent, thank you for review and merge!
>> >> >> >
>> >> >> >> We may consider backports down to 2.13 LTS.  Let me know
>> >> >> >> if it's needed.
>> >> >> >
>> >> >> > We will consume this at 2.13 and onwards, so a backport all the
>> way to
>> >> >> > 2.13 LTS would really be helpful.
>> >> >> >
>> >> >>
>> >> >> Done.
>> >> >> _______________________________________________
>> >> >> dev mailing list
>> >> >> dev@openvswitch.org
>> >> >>
>> https://urldefense.com/v3/__https://mail.openvswitch.org/mailman/listinfo/ovs-dev__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVFbGw-DU$
>>
>
Frode Nordahl Sept. 2, 2021, 5:31 a.m. UTC | #10
On Thu, Sep 2, 2021 at 1:25 AM aginwala <aginwala@asu.edu> wrote:
>
>
>
> On Wed, Sep 1, 2021 at 12:26 AM aginwala <aginwala@asu.edu> wrote:
>>
>>
>>
>> On Tue, Aug 31, 2021 at 11:26 PM Frode Nordahl <frode.nordahl@canonical.com> wrote:
>>>
>>> On Tue, Aug 31, 2021 at 8:28 PM aginwala <aginwala@asu.edu> wrote:
>>> >
>>> >
>>> >
>>> > On Tue, Aug 31, 2021 at 11:20 AM Frode Nordahl <frode.nordahl@canonical.com> wrote:
>>> >>
>>> >> On Tue, Aug 31, 2021 at 8:01 PM aginwala <aginwala@asu.edu> wrote:
>>> >> >
>>> >> > Hi:
>>> >> >
>>> >> > Thanks for this improvement. As per our recent tests with ovs 2.16 with 5.4* linux, the problem is that ovs-vswitchd adds ovs-record-hostname as required in the systemctl params.
>>> >> > Because of that debian installation of ovs always complaints
>>> >> >
>>> >> > Setting up openvswitch-switch (2.16.0-1) ...
>>> >> > insserv: warning: script 'iproutepolicy' missing LSB tags and overrides
>>> >> > Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service not found.
>>> >> > invoke-rc.d: initscript openvswitch-switch, action "restart" failed.
>>> >> > * openvswitch-switch.service - LSB: Open vSwitch switch
>>> >> >      Loaded: loaded (/etc/init.d/openvswitch-switch; generated)
>>> >> >      Active: inactive (dead) since Tue 2021-08-31 00:59:30 -07; 2h 24min ago
>>> >> >        Docs: man:systemd-sysv-generator(8)
>>> >> >
>>> >> > Main PID: 5960 (code=exited, status=0/SUCCESS)
>>> >> >
>>> >> > dpkg: error processing package openvswitch-switch (--install):
>>> >> >  installed openvswitch-switch package post-installation script subprocess returned error exit status 1
>>> >> >
>>> >> > Installation is ok as dpkg:error shows confusion
>>> >> > dpkg -l | grep openv
>>> >> >
>>> >> > Can be also seen on restart if vswitchd fails as debain install
>>> >> > systemctl restart openvswitch-switch.service
>>> >> > Failed to restart openvswitch-switch.service: Unit ovs-record-hostname.service not found.
>>> >> >
>>> >> > With ovs-ctl things works as expected.
>>> >> > Temp fix if we want to skip ovs-host-record for now is.
>>> >> >
>>> >> > rm /etc/systemd/system/openvswitch-switch.service.requires/ovs-record-hostname.service
>>> >> > systemctl daemon-reload
>>> >> >
>>> >> >
>>> >> > I saw upstream ubuntu does add ovs-record.service for debian packaging https://urldefense.com/v3/__https://code.launchpad.net/*fnordahl/ubuntu/*source/openvswitch/*git/openvswitch/*merge/398174__;fisrKw!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVCx3SwlA$
>>> >> >
>>> >> >
>>> >> > Seems it makes reasonable to port ovs-record-hostname for ovs debian packaging too to avoid error for 2.16.0 and master ovs branch to avoid systemctl issues.
>>> >> >
>>> >> > Please advice.
>>> >>
>>> >> Thank you for reaching out. The change made to the Open vSwitch
>>> >> repository itself for the ovn-ctl script was of an optional nature and
>>> >> is only opted into by those who want to use it. As you have found we
>>> >> do make use of this in Ubuntu, here we provide real systemd service
>>> >> files, including one for the separate recording of hostname, and do
>>> >> not rely on the systemd-sysv compatibility layer.
>>> >>
>>> >> I am not sure how the package you are looking at here came into this
>>> >> state, it is almost as if someone halfway enabled the feature? What is
>>> >> the source for the package you are displaying here?
>>> >>
>>> > https://urldefense.com/v3/__https://github.com/openvswitch/ovs/tree/v2.16.0__;!!IKRxdwAv5BmarQ!OovT7gtV1b9NvkRLizdRIY7Gviy8uckgpLx8-TfmSkPQp6Cr_GsaUsh8V6UvX08$  and building with debian build on kernel 5.4-80
>>> >
>>> > So, on ubuntu itself ovs-record-hostname can be optional for openvswitch vs being set as required on systemctl settings in 5.4* kernel.
>>> > or
>>> > add ovs-record-hostname.service in https://urldefense.com/v3/__https://github.com/openvswitch/ovs/tree/v2.16.0/debian__;!!IKRxdwAv5BmarQ!OovT7gtV1b9NvkRLizdRIY7Gviy8uckgpLx8-TfmSkPQp6Cr_GsaUsh8L1zplWw$  so that debain compilation will set that up.
>>> > That's what I can read from the current code so far.
>>>
>>> So I built debs from the currently tagged v2.16.0 sources and
>>> installed them on a clean system without any prior installation of
>>> Open vSwitch and I see no mention of a ovs-record-hostname.service and
>>> I have no issues starting or restarting the
>>> openvswitch-switch.service.  This service is also not mentioned in the
>>> debian package recipe in the OVS repository.
>>>
>>> Could the files you see in /etc/systemd be left over from a different
>>> package installation? Or am I misunderstanding the problem?
>>>
>> Hey thanks for trying out. I should have clarified earlier(my bad); the issue happens on kernel upgrade ; from older 4.* to 5.4.0-80  to ubuntu20.04(focal) where our kernel builds pulls openvswitch default debs https://launchpad.net/ubuntu/+source/openvswitch/2.13.3-0ubuntu0.20.04.1  that has ovs-record-hostname set in systemd. However, the newly generated ovs debian that we have on tag v2.16.0 from ovs source  doesn't have it. Since kernel upgrade touches openvswitch systemd settings, vswitchd with 2.16.0 complaints/fails. Seems it impacts the newer ubuntu versions. So not sure if we can improvise the openvswitch debains on ubuntu20 and onwards release as it seems to be imposed from canonical for ubuntu20 releases. Not sure if we should backport the same patch in ovs repo can help avoid systemd compatibility issues.
>
> For now we have fixed on our side by skipping installation of  ubuntu openvswitch-switch from canonnical while upgrading kernel using apt-mark hold openvswitch-switch to avoid ovs-record-hostname.service being added in sysctl
>
> dpkg-deb -c ./openvswitch-switch_2.13.3-0ubuntu0.20.04.1_amd64.deb | grep service
> -rw-r--r-- root/root       418 2021-03-17 02:48 ./lib/systemd/system/openvswitch-switch.service
> -rw-r--r-- root/root       540 2021-03-17 02:48 ./lib/systemd/system/ovs-record-hostname.service
> -rw-r--r-- root/root       934 2021-03-17 02:48 ./lib/systemd/system/ovs-vswitchd.service
>
> -rw-r--r-- root/root 774 2021-03-18 02:18 ./lib/systemd/system/ovsdb-server.service

That looks like a reasonable workaround, thank you for providing it here.

Guaranteeing the outcome of upgrades between packages of a disjoint
ancestry is virtually impossible, the debian package recipe in the ovs
and ovn repositories is currently living its own life and it does not
resemble what is actually in Debian or Ubuntu. We would be happy to
upstream our package sources and I'm sure the Debian maintainer would
agree, but it does depend on what other users there are of the in-tree
package recipes.

In the meantime, what we could do in Ubuntu is investigate whether
there should be postrm rules to make sure no systemd service
dependency links are left behind after one of our packages is
replaced.

--
Frode Nordahl

>>>
>>> --
>>> Frode Nordahl
>>>
>>> >>
>>> >> --
>>> >> Frode Nordahl
>>> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > On Tue, Mar 2, 2021 at 2:42 AM Ilya Maximets <i.maximets@ovn.org> wrote:
>>> >> >>
>>> >> >> On 3/2/21 6:52 AM, Frode Nordahl wrote:
>>> >> >> > On Mon, Mar 1, 2021 at 9:26 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>>> >> >> >>
>>> >> >> >> On 2/25/21 4:28 PM, Frode Nordahl wrote:
>>> >> >> >>> ovs-ctl determines the system FQDN or hostname and records it in
>>> >> >> >>> the `external-ids:hostname` field of the `Open-vSwitch` table on
>>> >> >> >>> system startup if it is not already set.
>>> >> >> >>>
>>> >> >> >>> This value may be consumed by downstream software and having it
>>> >> >> >>> unset or set to a incorrect value could lead to erratic behavior
>>> >> >> >>> of a system.
>>> >> >> >>>
>>> >> >> >>> When a system is configured to use an Open vSwitch controlled
>>> >> >> >>> datapath as its only network connection, the current ordering of
>>> >> >> >>> events would always record a unreliable hostname.
>>> >> >> >>>
>>> >> >> >>> To tackle this problem this patchs adds an optional argument that
>>> >> >> >>> allows starting Open vSwitch without recording the hostname in
>>> >> >> >>> the database as well as a new ctl command to record the hostname
>>> >> >> >>> separately. This command can be called by the system startup
>>> >> >> >>> scripts when the system is ready to collect and record this
>>> >> >> >>> information.
>>> >> >> >>>
>>> >> >> >>> Reported-At: https://urldefense.com/v3/__https://bugs.launchpad.net/bugs/1915829__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxV8PBtinU$
>>> >> >> >>> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
>>> >> >> >>> ---
>>> >> >> >>>  utilities/ovs-ctl.in | 41 +++++++++++++++++++++++++++--------------
>>> >> >> >>>  1 file changed, 27 insertions(+), 14 deletions(-)
>>> >> >> >>
>>> >> >> >> Thanks!
>>> >> >> >> I added a note to the NEWS file and applied to master.
>>> >> >> >
>>> >> >> > Excellent, thank you for review and merge!
>>> >> >> >
>>> >> >> >> We may consider backports down to 2.13 LTS.  Let me know
>>> >> >> >> if it's needed.
>>> >> >> >
>>> >> >> > We will consume this at 2.13 and onwards, so a backport all the way to
>>> >> >> > 2.13 LTS would really be helpful.
>>> >> >> >
>>> >> >>
>>> >> >> Done.
>>> >> >> _______________________________________________
>>> >> >> dev mailing list
>>> >> >> dev@openvswitch.org
>>> >> >> https://urldefense.com/v3/__https://mail.openvswitch.org/mailman/listinfo/ovs-dev__;!!IKRxdwAv5BmarQ!NOVNzYnNX0z7Is75RKTpkbzKWTqqhxvHQ8m4xEVtweIy9WE-BCw76yxVFbGw-DU$
diff mbox series

Patch

diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index be3aa083b..71800795c 100644
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -230,7 +230,9 @@  start_forwarding () {
     if test X"$OVS_VSWITCHD" = Xyes; then
         do_start_forwarding || return 1
     fi
-    set_hostname &
+    if test X"$RECORD_HOSTNAME" = Xyes; then
+        set_hostname &
+    fi
     return 0
 }
 
@@ -321,6 +323,7 @@  set_defaults () {
     SYSTEM_ID=
 
     FULL_HOSTNAME=yes
+    RECORD_HOSTNAME=yes
 
     DELETE_BRIDGES=no
     DELETE_TRANSIENT_PORTS=no
@@ -382,19 +385,24 @@  This program is intended to be invoked internally by Open vSwitch startup
 scripts.  System administrators should not normally invoke it directly.
 
 Commands:
-  start                   start Open vSwitch daemons
-  stop                    stop Open vSwitch daemons
-  restart                 stop and start Open vSwitch daemons
-  status                  check whether Open vSwitch daemons are running
-  version                 print versions of Open vSwitch daemons
-  load-kmod               insert modules if not already present
-  force-reload-kmod       save OVS network device state, stop OVS, unload kernel
-                          module, reload kernel module, start OVS, restore state
-  enable-protocol         enable protocol specified in options with iptables
-  delete-transient-ports  delete transient (other_config:transient=true) ports
-  start-ovs-ipsec         start Open vSwitch ipsec daemon
-  stop-ovs-ipsec          stop Open vSwitch ipsec daemon
-  help                    display this help message
+  start                       start Open vSwitch daemons
+  stop                        stop Open vSwitch daemons
+  restart                     stop and start Open vSwitch daemons
+  status                      check whether Open vSwitch daemons are running
+  version                     print versions of Open vSwitch daemons
+  load-kmod                   insert modules if not already present
+  force-reload-kmod           save OVS network device state, stop OVS, unload
+                              kernel module, reload kernel module, start OVS,
+                              restore state
+  enable-protocol             enable protocol specified in options with
+                              iptables
+  delete-transient-ports      delete transient (other_config:transient=true)
+                              ports
+  start-ovs-ipsec             start Open vSwitch ipsec daemon
+  stop-ovs-ipsec              stop Open vSwitch ipsec daemon
+  record-hostname-if-not-set  determine the system hostname and record it in
+                              the Open vSwitch database if not already set
+  help                        display this help message
 
 One of the following options is required for "start", "restart" and "force-reload-kmod":
   --system-id=UUID   set specific ID to uniquely identify this system
@@ -415,6 +423,8 @@  Less important options for "start", "restart" and "force-reload-kmod":
   --ovsdb-server-priority=NICE   set ovsdb-server's niceness (default: $OVSDB_SERVER_PRIORITY)
   --ovs-vswitchd-priority=NICE   set ovs-vswitchd's niceness (default: $OVS_VSWITCHD_PRIORITY)
   --no-full-hostname             set short hostname instead of full hostname
+  --no-record-hostname           do not attempt to determine/record system
+                                 hostname as part of start command
 
 Debugging options for "start", "restart" and "force-reload-kmod":
   --ovsdb-server-wrapper=WRAPPER
@@ -573,6 +583,9 @@  case $command in
     stop-ovs-ipsec)
         stop_ovs_ipsec
         ;;
+    record-hostname-if-not-set)
+        set_hostname
+        ;;
     help)
         usage
         ;;