配置文件:修订间差异

来自Domoticz
跳转到导航 跳转到搜索
无编辑摘要
 
(未显示1个用户的6个中间版本)
第1行: 第1行:
==介绍==
Domoticz的配置文件也是启动文件,默认文件路径:domoticz/domoticz.sh
Domoticz的配置文件也是启动文件,默认文件路径:domoticz/domoticz.sh


第5行: 第6行:
[[file:屏幕快照_2017-08-04_15.13.36.jpg]]
[[file:屏幕快照_2017-08-04_15.13.36.jpg]]


[code]DAEMON_ARGS="$DAEMON_ARGS -www 8080"
==端口==
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"[/code]
<syntaxhighlight lang="bash">DAEMON_ARGS="$DAEMON_ARGS -www 8080"
 
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"</syntaxhighlight>
 
这两行分别是http与https的端口号设置。
这两行分别是http与https的端口号设置。


==日志==
<syntaxhighlight lang="bash">#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"</syntaxhighlight>


[code]#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"[/code]
此行用来设置Domoticz日志记录,要启用日志记录需要将行首的井号#删掉,“/tmp/domoticz.txt”是用来存放日志的文件。
此行用来设置Domoticz日志记录,要启用日志记录需要将行首的井号#删掉,“/tmp/domoticz.txt”是用来存放日志的文件。
以后Domoticz出现问题,直接查看此文件即可。
以后Domoticz出现问题,直接查看此文件即可。


建议树莓派中,按[[为树莓派设置内存分区]]将/tmp建为内存分区,以防止频繁读写sd卡。
由于内存分区大小有限,建议每天删除一次日志文件:
<syntaxhighlight lang="bash">sudo crontab -e</syntaxhighlight>
在末尾增加一行:
<syntaxhighlight lang="bash">30 23 * * * sudo date > /tmp/domoticz.txt</syntaxhighlight>
这样系统会在每天晚上11点半自动将当前时间写入/tmp/domoticz.txt并覆盖原来的内容。


==! 注意 !==
树莓派中,设置开机自动启动Domoticz时,此文件复制到了“/etc/init.d/”目录中,修改时也需要修改“/etc/init.d/domoticz.sh”
树莓派中,设置开机自动启动Domoticz时,此文件复制到了“/etc/init.d/”目录中,修改时也需要修改“/etc/init.d/domoticz.sh”
修改方法:
修改方法:
[code]sudo vi /etc/init.d/domoticz.sh[/code]
<syntaxhighlight lang="bash">sudo vi /etc/init.d/domoticz.sh</syntaxhighlight>
修改完成后,需要重启Domoticz:
修改完成后,需要重启Domoticz:
[code]sudo service domoticz.sh restart[/code]
<syntaxhighlight lang="bash">sudo service domoticz.sh restart</syntaxhighlight>
这时可能会提示“Warning: Unit file of domoticz.service changed on disk, 'systemctl daemon-reload' recommended.”
这时可能会提示“Warning: Unit file of domoticz.service changed on disk, 'systemctl daemon-reload' recommended.”
直接执行:[code]sudo systemctl daemon-reload[/code]
直接执行:<syntaxhighlight lang="bash">sudo systemctl daemon-reload</syntaxhighlight>
然后在重启即可。
然后再次重启即可:
<syntaxhighlight lang="bash">sudo service domoticz.sh restart</syntaxhighlight>
 
[[Category:Domoticz]]
[[Category:手册]]
[[Category:配置]]

2017年10月23日 (一) 15:42的最新版本

介绍

Domoticz的配置文件也是启动文件,默认文件路径:domoticz/domoticz.sh

默认文件内容如下:

端口

DAEMON_ARGS="$DAEMON_ARGS -www 8080"

DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"

这两行分别是http与https的端口号设置。

日志

#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"

此行用来设置Domoticz日志记录,要启用日志记录需要将行首的井号#删掉,“/tmp/domoticz.txt”是用来存放日志的文件。 以后Domoticz出现问题,直接查看此文件即可。

建议树莓派中,按为树莓派设置内存分区将/tmp建为内存分区,以防止频繁读写sd卡。 由于内存分区大小有限,建议每天删除一次日志文件:

sudo crontab -e

在末尾增加一行:

30 23 * * * sudo date > /tmp/domoticz.txt

这样系统会在每天晚上11点半自动将当前时间写入/tmp/domoticz.txt并覆盖原来的内容。

! 注意 !

树莓派中,设置开机自动启动Domoticz时,此文件复制到了“/etc/init.d/”目录中,修改时也需要修改“/etc/init.d/domoticz.sh” 修改方法:

sudo vi /etc/init.d/domoticz.sh

修改完成后,需要重启Domoticz:

sudo service domoticz.sh restart

这时可能会提示“Warning: Unit file of domoticz.service changed on disk, 'systemctl daemon-reload' recommended.”

直接执行:

sudo systemctl daemon-reload

然后再次重启即可:

sudo service domoticz.sh restart