每当我想重新启动dnsmasq
服务时,都会收到此错误
root@ipm:/tftpboot# /etc/init.d/dnsmasq restart
[....] Restarting dnsmasq (via systemctl): dnsmasq.serviceJob for
dnsmasq.service failed because the control process exited with error code.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
failed!
正如错误消息中所述,这些命令中没有有用的信息。
# systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.con
Active: failed (Result: exit-code) since 2016-03-4 11:04:42 IRST; 3min 53s ago
Process: 18806 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=1/FAILURE)
14 11:04:42 systemd[1]: Starting dnsmasq - A lightweight DHCP .....
14 11:04:42 dnsmasq[18806]: dnsmasq: bad dhcp-range at line 4 o...f
14 11:04:42 systemd[1]: dnsmasq.service: Control process exite...=1
14 11:04:42 systemd[1]: Failed to start dnsmasq - A lightweigh...r.
14 11:04:42 systemd[1]: dnsmasq.service: Unit entered failed state.
14 11:04:42 systemd[1]: dnsmasq.service: Failed with result 'e...'.
Hint: Some lines were ellipsized, use -l to show in full.
的内容dnsmasq.conf
是
# cat /etc/dnsmasq.conf
interface=enp3s0
domain=hpclab
expand-hosts
dhcp-range=192.168.1.1,192.168.1.20,static
dhcp-option=42,0.0.0.0
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/tftpboot
dhcp-host=00:e0:81:c5:19:64,ws01,192.168.1.1
因此,第 4 行是dhcp-range=192.168.1.1,192.168.1.20,static
。我使用了与 ubuntu-12.04 相同的内容。
更新:
无论如何,正确的语法是dhcp-range=192.168.1.0,static
。我不知道它在 12.04 上是如何工作的!
答案1
4 11:04:42 dnsmasq[18806]: dnsmasq: 第 4 行的 dhcp 范围错误...
这对我来说似乎很有用 - 你读过吗?你的配置似乎有点问题。
提示:有些线条被省略了,使用 -l 可以完整显示。
这也是有用的信息 - 当你使用它时会发生什么?
systemctl status -l dnsmasq.service
认真地说,请阅读您看到的信息,我们不是错误消息阅读服务。