<分区>
我已经从我的 Redhat Linux 服务器上的外部 tar 文件安装了 OpenLdap(不是从默认的 rpm 包)。之后,我成功启动了服务 /usr/local/sbin/slapd
。此服务需要设置环境变量:
export LD_LIBRARY_PATH="/root/db-6.0.20/build_unix/.libs"
以便服务可以使用所有必需的库文件。但是我希望该服务能够在系统重启时自动重启。我在 /etc/init.d
下创建了到服务 /usr/local/sbin/slapd
的软链接(soft link):
lrwxrwxrwx 1 root root 21 Aug 5 14:34 slapd -> /usr/local/sbin/slapd
当我尝试检查执行 service slapd restart
时,它显示以下错误:
[root@dgseir init.d]# service slapd restart
/etc/init.d/slapd: error while loading shared libraries: libdb-6.0.so: cannot open shared object file: No such file or directory
因此,我无法使用 chkconfig
为此设置运行级别。但是,该服务从其绝对路径 /usr/local/sbin/slapd
运行良好,因为我在 .bash_profile
请帮助解决问题,或者让我知道任何其他方式让服务在服务器重启时自动重启