设置自定义配置时启动i8kmon服务时出错

第一篇文章,你们。 请温柔;)

我决定,无论i8kmon设置风扇速度的默认温度阈值是多少都不合适。 我似乎在负载下踢风扇,然后从不关闭(可能是因为较低的阈值温度设置得太低?)。

所以我开始在/ etc / default / i8kmon中创建自定义配置文件(如i8kmon联机帮助页中所述)。 该文件的内容正是这样的:

set config(0) {{0 0} "-"1 60 "-"1 65} set config(1) {{1 0} 50 70 55 75} set config(2) {{1 1} 60 80 65 85} set config(3) {{2 2} 70 128 75 128} 

然而,这似乎并不被i8kmon所喜欢,因为它在放置配置文件后不再有效。 这是systemctl status i8kmon.service的输出:

 systemctl status i8kmon.service ● i8kmon.service - LSB: Dell fan/cpu-temperature monitor Loaded: loaded (/etc/init.d/i8kmon; bad; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2016-01-04 20:33:57 PST; 9s ago Docs: man:systemd-sysv-generator(8) Process: 3766 ExecStop=/etc/init.d/i8kmon stop (code=exited, status=2) Process: 3770 ExecStart=/etc/init.d/i8kmon start (code=exited, status=2) Tasks: 2 (limit: 512) CGroup: /system.slice/i8kmon.service └─3545 tclsh /usr/bin/i8kmon --daemon --nouserconfig --auto Jan 04 20:33:57 notebook systemd[1]: i8kmon.service: Control process exited, code=exited status=2 Jan 04 20:33:57 notebook systemd[1]: Stopped LSB: Dell fan/cpu-temperature monitor. Jan 04 20:33:57 notebook systemd[1]: i8kmon.service: Unit entered failed state. Jan 04 20:33:57 notebook systemd[1]: i8kmon.service: Failed with result 'exit-code'. Jan 04 20:33:57 notebook systemd[1]: Starting LSB: Dell fan/cpu-temperature monitor... Jan 04 20:33:57 notebook i8kmon[3770]: /etc/init.d/i8kmon: 1: /etc/default/i8kmon: Syntax error: "(" unexpected Jan 04 20:33:57 notebook systemd[1]: i8kmon.service: Control process exited, code=exited status=2 Jan 04 20:33:57 notebook systemd[1]: Failed to start LSB: Dell fan/cpu-temperature monitor. Jan 04 20:33:57 notebook systemd[1]: i8kmon.service: Unit entered failed state. Jan 04 20:33:57 notebook systemd[1]: i8kmon.service: Failed with result 'exit-code'. 

但是,这是特别引起我兴趣的那一行,当然:

 Jan 04 20:33:57 notebook i8kmon[3770]: /etc/init.d/i8kmon: 1: /etc/default/i8kmon: Syntax error: "(" unexpected 

所以。 我相信我在配置文件中没有出现任何语法错误。 (请注意,它已逐字复制粘贴到配置文件中)。

同样有趣的是要注意这一点; 我在Fedora 23中成功地完成了这项工作(虽然这项工作更具手工性)。 关键区别(我记得)是1),文件放在/etc/i8kmon.conf中,而不是/ etc / default / i8kmon(由于某些原因,请注意Ubuntu中没有.conf),以及2) ,i8kmon的fedora联机帮助页没有要求在破折号周围使用奇怪的引号。

有什么想法吗?

您应该将配置文件放在/etc/i8kmon.conf而不是/etc/default/i8kmon 。 i8kmon实用程序是TK脚本,它具有配置文件的硬编码路径。 请参阅grep sysconfig /usr/bin/i8kmon

根据以下页面, /etc/default配置文件使用不兼容的逻辑将配置文件加载到执行shell的环境中,因此假设配置文件语法是shell的语法。 i8kmon手册页出错,因为它没有提到其他(原始)配置通道。 / etc / default的目的是什么? https://superuser.com/questions/46139/what-does-source-do