intel / openlldp

Other
54 stars 43 forks source link

Config file completely wiped on lldpad daemon stop/restart/SIGHUP #114

Open asphalter opened 1 week ago

asphalter commented 1 week ago

Hi all,

I'm currently running lldpad v1.1.1-3:

# rpm -qi lldpad
Name        : lldpad
Version     : 1.1.1
Release     : 3.gitf1dd9eb.el9
Architecture: x86_64
Install Date: Thu 14 Nov 2024 02:56:41 PM CET
Group       : Unspecified
Size        : 713305
License     : GPL-2.0-only
Signature   : RSA/SHA256, Wed 09 Oct 2024 09:16:02 AM CEST, Key ID 05b555b38483c65d
Source RPM  : lldpad-1.1.1-3.gitf1dd9eb.el9.src.rpm
Build Date  : Tue 10 Sep 2024 09:51:44 AM CEST
Build Host  : x86-01.stream.rdu2.redhat.com
Packager    : builder@centos.org
Vendor      : CentOS
URL         : https://github.com/intel/openlldp
Summary     : Intel LLDP Agent

This is started up on boot by systemd, and it creates a config file in /var/lib/lldpad/lldpad.conf

After some configurations issued by lldptool, the lldpad.conf file looks complete:

# cat /root/lldpad.conf 
<cut>
lldp : 
{
  eno1 : 
  {
    tlvid00000001 : 
    {
      info = "0420040FEBE37C";
    };
    tlvid00000002 : 
    {
      info = "05656E6F31";
      subtype = 5;
    };
    adminStatus = 3;
    tlvid00000005 : 
    {
      enableTx = true;
    };
    tlvid00000004 : 
    {
      enableTx = true;
    };
  };
<cut>
#

Unfortunately, when I shut down, restart or even reload (SIGHUP) the lldpad daemon, it decides to kill all the content of the config file:

# cat /root/lldpad.conf 
dcbx : 
{
  version = "1.0";
  dcbx_version = 2;
};
nearest_customer_bridge : 
{
};
nearest_nontpmr_bridge : 
{
};
lldp : 
{
};
#

Loading the daemon in debug mode, I can clearly see that it kills every port from the config file:

<cut>
14:49:48.040432 In remove_port: Found port eno2
14:49:48.040442 In remove_port: Found port eno2
14:49:48.046431 In remove_config_device, remove eno2 from section nearest_customer_bridge
14:49:48.046546 In remove_config_device, remove eno2 from section nearest_nontpmr_bridge
14:49:48.046664 In remove_config_device, remove eno2 from section lldp
<cut>

In my humble opinion, this seems due to the:

https://github.com/intel/openlldp/commit/a75e35a0cb36817e42a69ac14d1785cc63341132

Could you please give a look and let me know?

asphalter commented 1 week ago

I reverted to the previously distributed release v1.1.0-4 and everything worked as intended, leaving the configuration file in place at daemon shutdown.

# rpm -qi lldpad
Name        : lldpad
Version     : 1.1.0
Release     : 4.git85e5583.el9
Architecture: x86_64
Install Date: Tue 19 Nov 2024 03:40:14 PM CET
Group       : Unspecified
Size        : 702035
License     : GPLv2
Signature   : RSA/SHA256, Thu 12 Aug 2021 01:10:22 AM CEST, Key ID 05b555b38483c65d
Source RPM  : lldpad-1.1.0-4.git85e5583.el9.src.rpm
Build Date  : Tue 10 Aug 2021 02:23:45 AM CEST
Build Host  : x86-06.stream.rdu2.redhat.com
Packager    : builder@centos.org
Vendor      : CentOS
URL         : http://open-lldp.org/
Summary     : Intel LLDP Agent
Description :
This package contains the Linux user space daemon and configuration tool for
Intel LLDP Agent with Enhanced Ethernet support for the Data Center.
# 

Still waiting for this to be confirmed.

penguin359 commented 5 days ago

I was a little concerned about PR #110 when it was first requested, but it was merged before I had a chance to review it. A further update to it to fix the issue with removal upon shutdown in PR #112. Can you test against that PR with commit a75e35a0 included and see if that follows the behavior you expect?