linux启动错误:lldpad: config file failed to load

linux启动错误:lldpad: config file failed to load

  1. 查看lldpad信息:man lldpad(不存在时创建该文件) /conf --->定位OPTIONS

        lldpad has the following command line options:
    
        -h     show usage information
    
        -f filename
               use  the specified file as the configuration file instead of the
               default file:  /var/lib/lldpad/lldpad.conf  lldpad  expects  the
               directory of the configuration file to exist, but if the config‐
               uration file does not exist, then a default  configuration  file
               will  be  created.  lldpad creates and maintains the contents of
               the configuration file.  Configuration should  be  performed  by
               using lldptool or dcbtool.
         ...
    
  2. 使用locate lldpad|grep conf不存在该文件
  3. 输入lldpad产生lldpad.conf,
  4. find /var/log -type f -exec rm -v {}\; //delete log info
  5. find /var/log -type f|xargs grep failed 然仍然不能去除该错误. /var/log/messages:Feb 19 09:13:28 door2 lldpad: config file failed to load,
  6. google --lldpad: config file failed to load help me in https://github.com/openSUSE/lldpad/blob/master/config.c code:

    /*
    * init_cfg - initialze the global lldpad_cfg via config_init
    *
    * Returns true (1) for succes and false (0) for failed
    *
    * check to see if lldpad_cfs is already initailzied
    */
     int init_cfg(void)
     {
             const char *p;
             int err = 1;
    
             config_init(&lldpad_cfg);
    
             if (check_cfg_file()) {
                 err = 0;
                 LLDPAD_INFO("%s: failed to create config file\n", __func__);
             } else if (!config_read_file(&lldpad_cfg, cfg_file_name)) {
                 err = 0;
                 LLDPAD_INFO("%s: config file failed to load\n", __func__);
             } else if (config_lookup_string(&lldpad_cfg, "version", &p)) {
                 LLDPAD_INFO("%s: config file version incorrect ", __func__);
                 LLDPAD_INFO("rebuild file with correct version.\n");
                 destroy_cfg();
                 remove(cfg_file_name);
                 if (check_cfg_file() ||
                     !config_read_file(&lldpad_cfg, cfg_file_name))
                     err = 0;
             }
             return err;
     }
    
  7. ll /var/lib/lldpad/lldpad.conf -rw-------. 1 root root 587 11月 19 00:23 /var/lib/lldpad/lldpad.conf

  8. chmod 644 lldpad.conf

发表评论