Kannel 启动但不创建日志文件
Kannel starts but doesn't create log files
当我使用 service kannel start
启动 kannel 服务时,一切正常,kannel 确实启动了,但它不起作用。未创建日志文件且 /var/log/kannel/
目录为空,但我不知道为什么。
我的配置如下:
group = core
admin-port = 13000
admin-password = pass
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
access-log = "/var/log/kannel/access_kannel.log"
store-file = "/var/log/kannel/store_sms"
smsbox-port = 13001
dlr-storage = internal
sms-resend-retry = 1
group = smsc
smsc-id = povoljye
smsc = smpp
host = **.***.***.***
port = 2775
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = kemerovo
allowed-smsc-id = povoljye
preferred-smsc-id = povoljye
group = smsc
smsc-id = kemerovo
smsc = smpp
host = ***.***.***.***
port = 3102
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-add-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = povoljye
allowed-smsc-id = kemerovo
preferred-smsc-id = kemerovo
group = smsbox
bearerbox-host = localhost
sendsms-port = 13005
global-sender = 4105
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access_smsbox.log
group = sendsms-user
username = "user1"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = povoljye
group = sendsms-user
username = "user2"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = kemerovo
group = sms-service
keyword = default
post-url = "http://domain.com/sms/%p/time/%t/coding/%c/smsc/%i"
concatenation = true
max-messages = 0
这个问题的可能原因是什么以及如何找到更多信息?
我猜 kannel 用户无法写入您的 /var/log/kannel
。假设一个相当标准的安装,你可以尝试
sudo chown -R kannel:kannel /var/log/kannel
使 kannel 用户成为目录的所有者。然后重新启动它,日志应该出现在那里。或者你可以尝试任何其他权限的东西使目录可写(chmod
,将 kannel 添加到所有者组,或其他东西。)
您还可以在调试模式下从命令行启动 Kannel 并查看是否出现任何有趣的内容(有趣的意思是关于无法访问的目录或文件的错误消息,)例如:
/usr/local/sbin/bearerbox -v 0 -- /etc/kannel/kannel.conf
(假设是标准路径,如果你的不同,你应该改变它们。)
两个 SMSC 的工作配置:
group = core
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
access-log = "/var/log/kannel/access_kannel.log"
admin-port = 13000
admin-password = pass
store-file = "/var/log/kannel/store_sms"
smsbox-port = 13001
dlr-storage = internal
sms-resend-retry = 1
group = smsc
smsc-id = receivesend
smsc = smpp
host = **.**.***.***
port = 2775
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = onlysend
allowed-smsc-id = receivesend
preferred-smsc-id = receivesend
group = smsbox
bearerbox-host = localhost
sendsms-port = 13005
global-sender = 4105
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access_smsbox.log
group = smsc
smsc-id = onlysend
smsc = smpp
host = **.***.***.***
port = 3102
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = receivesend
allowed-smsc-id = onlysend
preferred-smsc-id = onlysend
group = sendsms-user
username = "user1"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = receivesend
group = sms-service
keyword = default
post-url = "http://*****.**/sms/%p/time/%t/coding/%c/smsc/%i"
concatenation = true
max-messages = 2
group = sendsms-user
username = "user2"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = onlysend
当我使用 service kannel start
启动 kannel 服务时,一切正常,kannel 确实启动了,但它不起作用。未创建日志文件且 /var/log/kannel/
目录为空,但我不知道为什么。
我的配置如下:
group = core
admin-port = 13000
admin-password = pass
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
access-log = "/var/log/kannel/access_kannel.log"
store-file = "/var/log/kannel/store_sms"
smsbox-port = 13001
dlr-storage = internal
sms-resend-retry = 1
group = smsc
smsc-id = povoljye
smsc = smpp
host = **.***.***.***
port = 2775
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = kemerovo
allowed-smsc-id = povoljye
preferred-smsc-id = povoljye
group = smsc
smsc-id = kemerovo
smsc = smpp
host = ***.***.***.***
port = 3102
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-add-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = povoljye
allowed-smsc-id = kemerovo
preferred-smsc-id = kemerovo
group = smsbox
bearerbox-host = localhost
sendsms-port = 13005
global-sender = 4105
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access_smsbox.log
group = sendsms-user
username = "user1"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = povoljye
group = sendsms-user
username = "user2"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = kemerovo
group = sms-service
keyword = default
post-url = "http://domain.com/sms/%p/time/%t/coding/%c/smsc/%i"
concatenation = true
max-messages = 0
这个问题的可能原因是什么以及如何找到更多信息?
我猜 kannel 用户无法写入您的 /var/log/kannel
。假设一个相当标准的安装,你可以尝试
sudo chown -R kannel:kannel /var/log/kannel
使 kannel 用户成为目录的所有者。然后重新启动它,日志应该出现在那里。或者你可以尝试任何其他权限的东西使目录可写(chmod
,将 kannel 添加到所有者组,或其他东西。)
您还可以在调试模式下从命令行启动 Kannel 并查看是否出现任何有趣的内容(有趣的意思是关于无法访问的目录或文件的错误消息,)例如:
/usr/local/sbin/bearerbox -v 0 -- /etc/kannel/kannel.conf
(假设是标准路径,如果你的不同,你应该改变它们。)
两个 SMSC 的工作配置:
group = core
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
access-log = "/var/log/kannel/access_kannel.log"
admin-port = 13000
admin-password = pass
store-file = "/var/log/kannel/store_sms"
smsbox-port = 13001
dlr-storage = internal
sms-resend-retry = 1
group = smsc
smsc-id = receivesend
smsc = smpp
host = **.**.***.***
port = 2775
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = onlysend
allowed-smsc-id = receivesend
preferred-smsc-id = receivesend
group = smsbox
bearerbox-host = localhost
sendsms-port = 13005
global-sender = 4105
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access_smsbox.log
group = smsc
smsc-id = onlysend
smsc = smpp
host = **.***.***.***
port = 3102
smsc-username = "***"
smsc-password = "***"
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
system-type = VMA
throughput = 1000
reconnect-delay = 5
connection-timeout = 120
transceiver-mode = true
denied-smsc-id = receivesend
allowed-smsc-id = onlysend
preferred-smsc-id = onlysend
group = sendsms-user
username = "user1"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = receivesend
group = sms-service
keyword = default
post-url = "http://*****.**/sms/%p/time/%t/coding/%c/smsc/%i"
concatenation = true
max-messages = 2
group = sendsms-user
username = "user2"
password = "pass"
concatenation = true
max-messages = 20
default-smsc = onlysend