问题描述
我正在尝试启动gammu sms服务,当我使用简单的存档运行它时,它运行良好,但是当我尝试使用mysql数据库运行它时,它显示此错误:
I'm trying to start the gammu sms service, when I run it with simple archives, it runs fine, but when I try to run it with the mysql database, it shows this error:
重新启动gammu-sms,显示此消息:
The restart gammu-sms, show this message:
user2@Lubuntu18:~$ service gammu-smsd restart
user2@Lubuntu18:~$ service gammu-smsd status
● gammu-smsd.service - SMS daemon for Gammu
Loaded: loaded (/lib/systemd/system/gammu-smsd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-08-18 20:55:21 -04; 2min 52s ago
Docs: man:gammu-smsd(1)
Process: 19001 ExecStopPost=/bin/rm -f /var/run/gammu-smsd.pid (code=exited, status=0/SUCCESS)
Process: 18999 ExecStart=/usr/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon (code=exited, status=0/SUCCESS)
Main PID: 19000 (code=exited, status=2)
ago 18 20:55:21 Lubuntu18 systemd[1]: Starting SMS daemon for Gammu...
ago 18 20:55:21 Lubuntu18 systemd[1]: gammu-smsd.service: Can't open PID file /var/run/gammu-smsd.pid (yet?) after start: No s
ago 18 20:55:21 Lubuntu18 systemd[1]: Started SMS daemon for Gammu.
ago 18 20:55:21 Lubuntu18 systemd[1]: gammu-smsd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
ago 18 20:55:21 Lubuntu18 systemd[1]: gammu-smsd.service: Failed with result 'exit-code'.
日志文件gammu smsd显示如下:
The log file gammu smsd show this:
Sat 2018/08/18 20:55:21 gammu-smsd[19000]: Error connecting to database!
Sat 2018/08/18 20:55:21 gammu-smsd[19000]: Error code: 2002, Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Sat 2018/08/18 20:55:21 gammu-smsd[19000]: Initialisation failed, stopping Gammu smsd: Database connection timeout. (DB_TIMEOUT[78])
Sat 2018/08/18 20:55:21 gammu-smsd[19000]: Stopping Gammu smsd: Sin error. (NONE[1])
Docs: man:gammu-smsd(1)
Process: 19001 ExecStopPost=/bin/rm -f /var/run/gammu-smsd.pid (code=exited, status=0/SUCCESS)
Process: 18999 ExecStart=/usr/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon (code=exited, status=0/SUCCESS)
Main PID: 19000 (code=exited, status=2)
ago 18 20:55:21 Lubuntu18 systemd[1]: Starting SMS daemon for Gammu...
ago 18 20:55:21 Lubuntu18 systemd[1]: gammu-smsd.service: Can't open PID file /var/run/gammu-smsd.pid (yet?) after start: No s
ago 18 20:55:21 Lubuntu18 systemd[1]: Started SMS daemon for Gammu.
ago 18 20:55:21 Lubuntu18 systemd[1]: gammu-smsd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
ago 18 20:55:21 Lubuntu18 systemd[1]: gammu-smsd.service: Failed with result 'exit-code'.
/etc/gammu-smsdrc是:
The /etc/gammu-smsdrc is:
# Configuration file for Gammu SMS Daemon
# Gammu library configuration, see gammurc(5)
[gammu]
device = /dev/ttyUSB0
name = USB Qualcomm__Incorporated Qualcomm_CDMA_Technologies_MSM
connection = at
logfile = /home/ruser2/gammu.log
logformat = textall
# SMSD configuration, see gammu-smsdrc(5)
[smsd]
runonreceive = /opt/lampp/htdocs/kalkun/scripts/daemon.sh
service = sql
Driver = native_mysql
PIN= 1234
logfile = /home/user2/gammusmsd.log
# Increase for debugging information
debuglevel = 0
user = kalkun
password = kalkun
pc = localhost
database = kalkun
我使用Lubuntu:
I use Lubuntu:
18.04
xampp 5.6.30
xampp 5.6.30
PHP版本5.6.23
PHP Version 5.6.23
有什么办法可以帮助我吗?非常感谢
Any idea to help me? thanks a lot
推荐答案
您的用户没有权限,您以user2@Lubuntu18
身份启动.
Your user has no permission, you started as user2@Lubuntu18
.
尝试以root身份启动gammu-smsd,或向用户2添加权限dialout
.
Try to start gammu-smsd as root, or add permission dialout
to user2.
sudo gammu-smsd -d --user gammu --group dialout
这篇关于如何使用mysql配置gammu-smsd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!