On 12/15/22 15:38, Timothy Redaelli wrote:
> On Tue, 13 Dec 2022 12:57:08 +0100
> Ilya Maximets <[email protected]> wrote:
> 
>> On 12/5/22 15:36, Ilya Maximets wrote:
>>> On 12/4/22 09:23, Roi Dayan wrote:
>>>>
>>>>
>>>> On 30/11/2022 17:55, Ilya Maximets wrote:
>>>>> On 11/14/22 20:41, Timothy Redaelli wrote:
>>>>>> conf.db is by default at /etc/openvswitch, but it should be at
>>>>>> /var/lib/openvswitch like on Debian or like ovnnb_db.db and ovnsb_db.db.
>>>>>>
>>>>>> If conf.db already exists in /etc/openvswitch then it's moved to
>>>>>> /var/lib/openvswitch.
>>>>>> Symlinks are created for conf.db and .conf.db.~lock~ into 
>>>>>> /etc/openvswitch
>>>>>> for backward compatibility.
>>>>>>
>>>>>> Reported-at: 
>>>>>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.redhat.com%2F1830857&amp;data=05%7C01%7Croid%40nvidia.com%7Cd69116141ff645fc2c7308dad2eb4612%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638054205222362304%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BIcIVZBKrfhIpq%2B6r6I3QvjdZ9KvjLsrRSlvi9kFHzc%3D&amp;reserved=0
>>>>>> Reported-by: Yedidyah Bar David <[email protected]>
>>>>>> Signed-off-by: Timothy Redaelli <[email protected]>
>>>>>> ---
>>>>>> v1 -> v2:
>>>>>> - Use hugetlbfs group instead of openvswitch when the package is built
>>>>>>   with dpdk (as reported by Flavio)
>>>>>> ---
>>>>>>  rhel/openvswitch-fedora.spec.in | 27 +++++++++++++++++++++++----
>>>>>>  1 file changed, 23 insertions(+), 4 deletions(-)
>>>>>
>>>>> If that works for Fedora, then LGTM.  Applied.
>>>>>
>>>>> Thanks!
>>>>> Best regards, Ilya Maximets.
>>>>> _______________________________________________
>>>>> dev mailing list
>>>>> [email protected]
>>>>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-dev&amp;data=05%7C01%7Croid%40nvidia.com%7Cd69116141ff645fc2c7308dad2eb4612%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638054205222362304%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=fZZh4iYeUu%2BL2%2F%2FWTIgPNzpvfhpe%2F9MANkVPLmv57aY%3D&amp;reserved=0
>>>>
>>>>
>>>> hi,
>>>>
>>>> This commit expose some kind of issue and cause openvswitch not
>>>> to start on clean systems.
>>>>
>>>> If old conf.db file didn't exists it creates an empty conf.db with
>>>> the touch command.
>>>> Empty conf.db cause ovsdb-server not to start.
>>>>
>>>> #  /usr/share/openvswitch/scripts/ovs-ctl start
>>>> ovsdb-tool: ovsdb error: /etc/openvswitch/conf.db: cannot identify file 
>>>> type
>>>> Starting ovsdb-server ovsdb-server: ovsdb error: /etc/openvswitch/conf.db: 
>>>> cannot identify file type
>>>>                                                            [FAILED]
>>>>
>>>> If I remove the conf.db file (can leave the symbolic link in /etc)
>>>> then ovs starts fine.
>>>> # rm /var/lib/openvswitch/conf.db
>>>> #  /usr/share/openvswitch/scripts/ovs-ctl start
>>>> /etc/openvswitch/conf.db does not exist ... (warning).
>>>> Creating empty database /etc/openvswitch/conf.db           [  OK  ]
>>>> Starting ovsdb-server                                      [  OK  ]
>>>> system ID not configured, please use --system-id ... failed!
>>>> Configuring Open vSwitch system IDs                        [  OK  ]
>>>> Starting ovs-vswitchd                                      [  OK  ]
>>>> Enabling remote OVSDB managers                             [  OK  ]
>>>>
>>>>
>>>> I'm not sure where it's better to fix this. either the spec here
>>>> not to create an empty file or in ovsdb/log.c to an accept empty conf.db,
>>>> or maybe even upgrade_db() in ovs-lib bash file to call create_db
>>>> even if conf.db exists but it's empty.
>>>
>>> Thanks, Roi, for the report!
>>> I think, fixing the spec should be the right approach here.
>>
>> Hi, Timothy.  Do you plan to work on the fix for this issue?
> 
> Yes sure, I'll do that today or tomorrow
> 
>> Otherwise we may just revert the change for now until the proper
>> fix is available.  Thoughts?
> 
> I prefer just to fix it, without the revert, if it's possible

If you know how to fix that, than sure.  I tried to quickly come up
with a fix before sending a revert patch, but I wasn't successful.

Here is what I tried:

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 4a3e6294b..ebb6a46ed 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -339,11 +339,10 @@ for base in conf.db .conf.db.~lock~; do
     if test ! -e $old && test ! -h $old; then
         ln -s $new $old
     fi
-    touch $new
 %if %{with dpdk}
-    chown openvswitch:hugetlbfs $new
+    chown -h openvswitch:hugetlbfs $old
 %else
-    chown openvswitch:openvswitch $new
+    chown -h openvswitch:openvswitch $old
 %endif
 done
 
---

With that the ovsdb-server service still fails to start on my system.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to