我正在尝试安装 Gammu 1.42 以在 Centos 8 上为我的 SMS 网关提供服务。
制作,制作测试,制作安装工作正常。
LD_LIBRARY_PATH 在 /etc/profile 中配置为:
......
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:.:/usr/local/lib64
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL LD_LIBRARY_PATH
......
我通过 printenv 打印 env,找到了 LD_LIBRARY_PATH。/etc/gammu-smsdrc 配置为:
......
[gammu]
device = /dev/ttyUSB0
model = E3131
connection = at115200
[smsd]
service = sql
driver = native_pgsql
logFIle = /var/log/gammu/smsd.log
logFormat = errorsdate
Host = xx.0.1.xx:xxxx
user = xxxx
password = xxxxx
database = xxxxx
debuglevel = 2
StatusFrequency = 60
LoopSleep = 60
DeliveryReport = sms
PhoneID = ozssc-smsd
SMSC = +614xxxxxxxx
BackendRetries = 60
我尝试在终端中启动 gammu 命令行,它工作正常。但是当我尝试使用 systemctl 启动系统服务时,它失败了。
错误查询结果为:
[root@Centos8Gateway etc]# systemctl status gammu-smsd.service
● gammu-smsd.service - SMS daemon for Gammu
Loaded: loaded (/usr/lib/systemd/system/gammu-smsd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-10-25 12:13:42 AEDT; 19s ago
Docs: man:gammu-smsd(1)
Process: 23247 ExecStopPost=/bin/rm -f /var/run/gammu-smsd.pid (code=exited, status=0/SUCCESS)
Process: 23245 ExecStart=/usr/local/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon (code=exited, status=127)
Oct 25 12:13:42 Centos8Gateway systemd[1]: Starting SMS daemon for Gammu...
Oct 25 12:13:42 Centos8Gateway gammu-smsd[23245]: /usr/local/bin/gammu-smsd: error while loading shared libraries: libgsmsd.so.8: cannot open shared object file: No such file or directory
Oct 25 12:13:42 Centos8Gateway systemd[1]: gammu-smsd.service: Control process exited, code=exited status=127
Oct 25 12:13:42 Centos8Gateway systemd[1]: gammu-smsd.service: Failed with result 'exit-code'.
Oct 25 12:13:42 Centos8Gateway systemd[1]: Failed to start SMS daemon for Gammu.
[root@Centos8Gateway etc]#
我试图找出为什么 Centos 8 系统服务加载器不使用配置的系统环境变量?并且不提供命令行 LD lib 路径参数。
我错过了什么?请指教!