Dnsmasq: junk found in command line 无法启动解决办法

本文最后更新时间 ☞

问题现象

场景

安装 Dnsmasq 后,程序没有启动。

问题

使用 systemctl start dnsmasq.service 尝试启动程序,启动失败,提示如下错误:

Job for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 'journalctl -xn' for details.

然后使用 systemctl status dnsmasq.service 查看原因,提示如下错误:

● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
  Drop-In: /run/systemd/generator/dnsmasq.service.d
           └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
   Active: failed (Result: exit-code) since Sun 2019-11-03 12:26:36 CST; 55s ago
  Process: 28719 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
  Process: 28716 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Nov 03 12:26:36 debian dnsmasq[28716]: dnsmasq: syntax check OK.
Nov 03 12:26:36 debian dnsmasq[28719]: dnsmasq: junk found in command line
Nov 03 12:26:36 debian dnsmasq[28719]: junk found in command line
Nov 03 12:26:36 debian dnsmasq[28719]: FAILED to start up
Nov 03 12:26:36 debian systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Nov 03 12:26:36 debian systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Nov 03 12:26:36 debian systemd[1]: Unit dnsmasq.service entered failed state.

故因 junk found in command line 无法启动,尝试卸载重新安装 Dnsmasq 问题照旧。


解决办法

执行以下命令进行清理:

apt-get purge dns-root-data -y

然后再使用 systemctl start dnsmasq.service 启动程序即可正常运行。

发表评论