为了使Raspberry Pi能够掌控我的工作,我建立了Mosquitto MQTT经纪人。在基本设置中,一切正常。
我可以使用publish命令发布测试消息,并使用subscription命令接收它们。然后,我决定提高日志级别,并如下修改了mosquitto.conf文件。基本上整个日志部分的版本都注释掉了。另一个没有。
我将其范围缩小到了日志文件所在的行。
$ diff mosquitto.conf mosquitto.conf.old
408,410c408,410
< #log_dest file /var/log/mosquitto/mosquitto.log
---
> log_dest file /var/log/mosquitto/mosquitto.log
该文件存在,并由mosquitto:mosquitto
运行服务的用户拥有。
尝试进行日志记录时,得到的非常有用的信息如下:
mosquitto_pub -h localhost -t thisisme -m 5
Error: Connection refused
到现在为止,我确信该服务将死于无声死亡。
$ sudo service mosquitto status
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto)
Active: active (exited) since Fri 2017-01-06 11:16:38 CET; 4min 24s ago
Process: 2222 ExecStop=/etc/init.d/mosquitto stop (code=exited, status=0/SUCCESS)
Process: 2230 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)
Jan 06 11:16:38 T-Pi mosquitto[2230]: Starting network daemon:: mosquitto.
Jan 06 11:16:38 T-Pi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.
我正在使用以下mosquitto软件包运行Raspbian GNU / Linux 8(jessie):
libmosquitto1/stable,now 1.3.4-2 armhf [installed,automatic]
mosquitto/stable,now 1.3.4-2 armhf [installed]
mosquitto-clients/stable,now 1.3.4-2 armhf [installed]
python-mosquitto/stable,now 1.3.4-2 all [installed]
需要进一步评论的信息:
ls -ld /var /var/log /var/log/mosquitto /var/log/mosquitto/mosquitto.log
drwxr-xr-x 11 root root 4096 Sep 23 06:02 /var
drwxr-xr-x 8 root root 4096 Jan 6 21:07 /var/log
drwxr-xr-x 2 mosquitto mosquitto 4096 Jan 5 14:36 /var/log/mosquitto
-rw-r--r-- 1 mosquitto mosquitto 14233 Jan 6 21:07 /var/log/mosquitto/mosquitto.log
/ var / log中唯一被修改的日志文件是我sudo的auth.log。
我弄坏了什么?
/var/log/mosquitto/mosquitto.log
吗?