An error occurred while debugging zabbix recently:
/etc/init.d/zabbix_agentd start Starting zabbix_agentd: /opt/program/zabbix/sbin/zabbix_agentd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory [FAILED]
Cause analysis:
LD prompts that the library file cannot be found, and the library file is in the current directory.
The default directory of the linker LD is/lib and/usr/lib. If it is placed in another path, you need to let the LD know where the library file is.
Method 1:
Edit the/etc/lD. So. conf file and add the directory where the file is located in the new row;
Run ldconfig to update the/etc/lD. So. cache file;
Method 2:
Create a file with the. conf Suffix in the/etc/lD. So. conf. d/directory, and add the directory where the file is located to the file;
Run ldconfig to update the/etc/lD. So. cache file;
I think the second method is more convenient, with the minimum modification to the original system. Because the content of the/etc/lD. So. conf file is include/etc/lD. So. conf. d/*. conf. Therefore, any file added with the. conf suffix under the/etc/lD. So. conf. d/directory can be identified.
My practice:
1. put all the databases required by users to/usr/loca/LIB; 2. in/etc/lD. so. conf. d/directory to create a new file usr-libs.conf, the content is:/usr/local/lib 3. # sudo ldconfig
Update of LD. So. cache is incremental, just like the path system environment variable. Instead of re-establishing from scratch, the update is accumulated up.
Unless it is restarted, the LD. So. cache file is created from scratch.
This article is from the Nick blog, please be sure to keep this source http://nicking.blog.51cto.com/8167627/1551082
Error while loading shared libraries: libiconv. so.2