dnsmasq falhou ao iniciar no Debian

dnsmasq falhou ao iniciar no Debian

Este é o conteúdo do status systemctl dnsmasq.service:

● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-06-29 12:37:37 CEST; 23s ago
  Process: 24641 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
  Process: 24638 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Este é o conteúdo do diário:

-- Logs begin at Tue 2019-06-25 11:49:21 CEST, end at Sat 2019-06-29 12:48:50 CEST. --
Jun 25 11:49:29 EddLinux kernel: nouveau 0000:01:00.0: preinit failed with -22
Jun 25 11:49:29 EddLinux kernel: nouveau: DRM:00000000:00000080: init failed with -22
Jun 25 11:49:32 EddLinux avahi-daemon[297]: chroot.c: open() failed: No such file or directory
Jun 25 11:49:33 EddLinux systemd-rfkill[421]: Failed to open device: No such device
Jun 25 11:49:35 EddLinux dhclient[502]: Failed to get interface index: No such device
Jun 25 11:49:35 EddLinux dhclient[502]: 
Jun 25 11:49:35 EddLinux dhclient[502]: If you think you have received this message due to a bug rather
Jun 25 11:49:35 EddLinux dhclient[502]: than a configuration issue please read the section on submitting
Jun 25 11:49:35 EddLinux dhclient[502]: bugs on either our web page at www.isc.org or in the README file
Jun 25 11:49:35 EddLinux dhclient[502]: before submitting a bug.  These pages explain the proper
Jun 25 11:49:35 EddLinux dhclient[502]: process and the information we find helpful for debugging..
Jun 25 11:49:35 EddLinux dhclient[502]: 
Jun 25 11:49:35 EddLinux dhclient[502]: exiting.
Jun 25 11:49:35 EddLinux systemd[1]: Failed to start Raise network interfaces.
Jun 25 11:49:44 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 12:17:49 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 13:32:38 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 13:32:43 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 17:36:10 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 18:29:26 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 25 18:46:36 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 18:50:57 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 12:29:22 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 13:08:52 EddLinux anacron[4522]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 26 14:20:05 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 14:31:18 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 15:38:34 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 15:38:47 EddLinux kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 26 15:38:47 EddLinux kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 26 15:42:56 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 15:52:46 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 16:21:11 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 17:39:35 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 18:16:05 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 18:25:44 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 20:30:11 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 27 16:39:10 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 27 17:06:50 EddLinux anacron[11980]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 27 17:38:13 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 27 18:11:44 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 27 18:12:28 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 27 18:50:12 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 28 11:46:18 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 28 11:48:33 EddLinux kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 28 11:48:33 EddLinux kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 28 11:48:55 EddLinux kernel: FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
Jun 28 11:53:31 EddLinux kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 28 11:53:31 EddLinux kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 28 11:53:41 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 28 12:08:31 EddLinux anacron[17533]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 28 12:52:24 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 29 12:13:35 EddLinux anacron[21404]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 29 12:35:05 EddLinux dnsmasq[24574]: failed to create listening socket for port 53: Address already in use
Jun 29 12:35:05 EddLinux dnsmasq[24574]: FAILED to start up
Jun 29 12:35:05 EddLinux systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jun 29 12:37:37 EddLinux dnsmasq[24641]: failed to create listening socket for port 53: Address already in use
Jun 29 12:37:37 EddLinux dnsmasq[24641]: FAILED to start up
Jun 29 12:37:37 EddLinux systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.

Eu já reinstalei. Qualquer ajuda será bem-vinda!

Responder1

O problema

falha ao criar soquete de escuta para a porta 53: endereço já em uso

É isso.

O DNS usa consultas que enviam dados na porta 53 (na maioria das vezes UDP, mas o TCP também pode ser usado).

dnsmasqé (entre outras coisas) um chamado DNS de encaminhamentoservidor,e o fato de ser um servidor significa que ele querouvirem pelo menos 53/UDP e também talvez em 53/TCP.

Apenas um único processo (programa em execução) é capaz de escutar em uma porta com um número específico em um endereço IP específico. Portanto, o erro significa que algum outro programa já escuta na porta 53, dnsmasqnão consegue fazer isso e sai.

o que fazer sobre isso

Primeiro, descubra o que está ouvindo em 53/UDP.

  1. Instalar iproute2:

    # apt install iproute2
    
  2. Veja quem está usando 53/UDP:

    # ss -nlup
    

    As opções significam:

    • Mostrarnendereços numéricos, não tente resolvê-los por DNS.
    • Apenas mostrareusoquetes de escuta.
    • Apenas mostrarvocêsoquetes dp (na verdade, endpoints, mas não importa).
    • Mostrarpprocessos que abriram esses soquetes.

    (Observe que você deve executar este programa como root—talvez via sudo; isso depende de como você configurou a forma de elevar privilégios em seu sistema.)

    Agora localize um registro na saída contendo algo como [::]:53- a leitura exata pode ser diferente, digamos, 0.0.0.0:53, mas você verá esse :53sufixo com certeza - esse é o número da porta - e então verá a coluna "usuários" - ela deve listar o nome do programa que abriu esse soquete.

    Digamos, no meu sistema, a aparência relevante é UNCONN 0 0 [::]:53 [::]:* users:(("dnsmasq",pid=601,fd=6))(condensei um pouco os espaços em branco para ser breve). Observe que o usuário é dnsmasq; no seu sistema isso será diferente.

OK, depois de descobrir quem é o culpado, tente pensar em como desinstalar esse programa. Depois de fazer isso, o simples # systemctl restart dnsmasqterá o seu caminho.

informação relacionada