每当我想重新启动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 是如何工作的!
这对我来说看起来很有用——你读过吗?好像你的配置有问题。
这也是有用的信息——当你使用它时会发生什么?
说真的,请阅读您提供的信息,我们不是错误消息阅读服务。