LXC loop de repetição infinita

0

(Por favor, veja abaixo as atualizações 1, 2 e 3)

Hoje atualizei o sistema host e depois de uma reinicialização, o daemon LXD não é iniciado.

Dá o erro

failed to create listening socket for 10.104.52.1: Address already in use

O que posso fazer?

Eu tenho:

  • Ubuntu 16.04.3 LTS
  • lxd 2,16 3346 canônico - (versão snap)

O comando que usei para iniciar

sudo systemctl start snap.lxd.daemon.service

Extrair do syslog:

Aug 15 20:05:52 s4 lxc[23200]: cmd.go:118: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
Aug 15 20:06:12 s4 systemd[1]: Started Service for snap application lxd.daemon.
Aug 15 20:06:12 s4 /usr/bin/snap[23219]: cmd.go:118: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
Aug 15 20:06:12 s4 snap[23219]: => Preparing the system
Aug 15 20:06:12 s4 snap[23219]: ==> Preparing a clean copy of /run
Aug 15 20:06:12 s4 snap[23219]: ==> Preparing a clean copy of /etc
Aug 15 20:06:12 s4 snap[23219]: ==> Setting up ceph configuration
Aug 15 20:06:12 s4 snap[23219]: ==> Setting up LVM configuration
Aug 15 20:06:12 s4 snap[23219]: ==> Escaping the systemd cgroups                                                                                                                     
Aug 15 20:06:12 s4 snap[23219]: ==> Escaping the systemd process resource limits                                                                                                     
Aug 15 20:06:12 s4 snap[23219]: ==> Enabling unprivileged containers kernel support                                                                                                  
Aug 15 20:06:12 s4 snap[23219]: => Starting LXCFS                                                                                                                                    
Aug 15 20:06:12 s4 snap[23219]: => Starting LXD                                                                                                                                      
Aug 15 20:06:12 s4 kernel: [  767.318344] cgroup: new mount options do not match the existing superblock, will be ignored                                                            
Aug 15 20:06:12 s4 snap[23219]: lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2017-08-15T18:06:12+0000                                    
Aug 15 20:06:12 s4 snap[23219]: hierarchies:                                                                                                                                         
Aug 15 20:06:12 s4 snap[23219]:   0: fd:   5: memory                                                                                                                                 
Aug 15 20:06:12 s4 snap[23219]:   1: fd:   6: blkio                                                                                                                                  
Aug 15 20:06:12 s4 snap[23219]:   2: fd:   7: hugetlb                                                                                                                                
Aug 15 20:06:12 s4 snap[23219]:   3: fd:   8: cpuset                                                                                                                                 
Aug 15 20:06:12 s4 snap[23219]:   4: fd:   9: devices
Aug 15 20:06:12 s4 snap[23219]:   5: fd:  10: net_cls,net_prio
Aug 15 20:06:12 s4 snap[23219]:   6: fd:  11: freezer
Aug 15 20:06:12 s4 snap[23219]:   7: fd:  12: pids
Aug 15 20:06:12 s4 snap[23219]:   8: fd:  13: perf_event
Aug 15 20:06:12 s4 snap[23219]:   9: fd:  14: cpu,cpuacct
Aug 15 20:06:12 s4 snap[23219]:  10: fd:  15: name=systemd
Aug 15 20:06:12 s4 avahi-daemon[1986]: Withdrawing address record for 10.104.52.1 on lxdbr0.
Aug 15 20:06:12 s4 avahi-daemon[1986]: Leaving mDNS multicast group on interface lxdbr0.IPv4 with address 10.104.52.1.
Aug 15 20:06:12 s4 avahi-daemon[1986]: Interface lxdbr0.IPv4 no longer relevant for mDNS.
Aug 15 20:06:12 s4 named[2579]: no longer listening on 10.104.52.1#53
Aug 15 20:06:12 s4 avahi-daemon[1986]: Joining mDNS multicast group on interface lxdbr0.IPv4 with address 10.104.52.1.
Aug 15 20:06:12 s4 avahi-daemon[1986]: New relevant interface lxdbr0.IPv4 for mDNS.
Aug 15 20:06:12 s4 avahi-daemon[1986]: Registering new address record for 10.104.52.1 on lxdbr0.IPv4.
Aug 15 20:06:12 s4 named[2579]: listening on IPv4 interface lxdbr0, 10.104.52.1#53
Aug 15 20:06:12 s4 dnsmasq[23351]: failed to create listening socket for 10.104.52.1: Address already in use
Aug 15 20:06:12 s4 dnsmasq[23351]: FAILED to start up

=========== UPDATE ================================ ==

Após um novo começo da energia no daemon LXC, insira um loop de reinicialização sem fim. Tentei parar o daemon; mas termina em um estado de erro. Aqui a transcrição:

sysop@s4:~$ lxc list
LXD socket not found; is LXD installed and running?
sysop@s4:~$ sudo systemctl stop snap.lxd.daemon.service
[sudo] password di sysop: 
sysop@s4:~$ sudo systemctl status snap.lxd.daemon.service
● snap.lxd.daemon.service - Service for snap application lxd.daemon
Loaded: loaded (/etc/systemd/system/snap.lxd.daemon.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since mer 2017-08-16 06:26:41 CEST; 33s ago
Process: 32064 ExecStop=/usr/bin/snap run --command=stop lxd.daemon (code=exited, status=0/SUCCESS)
Process: 29801 ExecStart=/usr/bin/snap run lxd.daemon (code=exited, status=1/FAILURE)
Main PID: 29801 (code=exited, status=1/FAILURE)

ago 16 06:26:39 s4 snap[29526]: action=shutdown created=2017-08-06T10:45:02+0000 ephemeral=false lvl=eror msg="Failed shutting down container" name=liferaybase t=2017-08-16T04:26:39
ago 16 06:26:39 s4 snap[29526]: lvl=warn msg="Unable to update backup.yaml at this time." name=cybersec t=2017-08-16T04:26:39+0000
ago 16 06:26:39 s4 snap[29526]: lvl=warn msg="Unable to update backup.yaml at this time." name=liferaybase t=2017-08-16T04:26:39+0000
ago 16 06:26:39 s4 snap[29526]: lvl=warn msg="Unable to update backup.yaml at this time." name=servizi t=2017-08-16T04:26:39+0000
ago 16 06:26:39 s4 snap[29526]: lvl=warn msg="Unable to update backup.yaml at this time." name=db-server t=2017-08-16T04:26:39+0000
ago 16 06:26:40 s4 snap[29526]: lvl=warn msg="Unable to update backup.yaml at this time." name=icons t=2017-08-16T04:26:40+0000
ago 16 06:26:40 s4 snap[32064]: => Stopping LXCFS
ago 16 06:26:41 s4 systemd[1]: Stopped Service for snap application lxd.daemon.
ago 16 06:26:41 s4 systemd[1]: snap.lxd.daemon.service: Unit entered failed state.
ago 16 06:26:41 s4 systemd[1]: snap.lxd.daemon.service: Failed with result 'exit-code'.
sysop@s4:~$ 

Como posso limpar o estado do erro?

============================= UPDATE 2 ============= ====================

Saída no syslog de "sudo systemctl start snap.lxd.daemon.service"

Aug 16 11:09:44 s4 systemd[1]: Started Service for snap application lxd.daemon.
Aug 16 11:09:44 s4 /usr/bin/snap[25736]: cmd.go:189: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
Aug 16 11:09:44 s4 snap[25736]: => Preparing the system
Aug 16 11:09:44 s4 snap[25736]: ==> Preparing a clean copy of /run
Aug 16 11:09:44 s4 snap[25736]: ==> Preparing a clean copy of /etc
Aug 16 11:09:44 s4 snap[25736]: ==> Setting up ceph configuration
Aug 16 11:09:44 s4 snap[25736]: ==> Setting up LVM configuration
Aug 16 11:09:44 s4 snap[25736]: ==> Escaping the systemd cgroups
Aug 16 11:09:44 s4 snap[25736]: ==> Escaping the systemd process resource limits
Aug 16 11:09:44 s4 snap[25736]: ==> Enabling unprivileged containers kernel support
Aug 16 11:09:44 s4 snap[25736]: => Starting LXCFS
Aug 16 11:09:44 s4 snap[25736]: => Starting LXD
Aug 16 11:09:44 s4 kernel: [ 1154.222272] cgroup: new mount options do not match the existing superblock, will be ignored
Aug 16 11:09:44 s4 snap[25736]: lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2017-08-16T09:09:44+0000
Aug 16 11:09:44 s4 snap[25736]: => LXD is ready
Aug 16 11:09:44 s4 snap[25736]: hierarchies:
Aug 16 11:09:44 s4 snap[25736]:   0: fd:   5: freezer
Aug 16 11:09:44 s4 snap[25736]:   1: fd:   6: devices
Aug 16 11:09:44 s4 snap[25736]:   2: fd:   7: memory
Aug 16 11:09:44 s4 snap[25736]:   3: fd:   8: pids
Aug 16 11:09:44 s4 snap[25736]:   4: fd:   9: perf_event
Aug 16 11:09:44 s4 snap[25736]:   5: fd:  10: hugetlb
Aug 16 11:09:44 s4 snap[25736]:   6: fd:  11: cpuset
Aug 16 11:09:44 s4 snap[25736]:   7: fd:  12: blkio
Aug 16 11:09:44 s4 snap[25736]:   8: fd:  13: cpu,cpuacct
Aug 16 11:09:44 s4 snap[25736]:   9: fd:  14: net_cls,net_prio
Aug 16 11:09:44 s4 snap[25736]:  10: fd:  15: name=systemd
Aug 16 11:09:44 s4 avahi-daemon[1993]: Withdrawing address record for 10.104.52.1 on lxdbr0.
Aug 16 11:09:44 s4 avahi-daemon[1993]: Leaving mDNS multicast group on interface lxdbr0.IPv4 with address 10.104.52.1.
Aug 16 11:09:44 s4 avahi-daemon[1993]: Interface lxdbr0.IPv4 no longer relevant for mDNS.
Aug 16 11:09:44 s4 named[2591]: no longer listening on 10.104.52.1#53
Aug 16 11:09:44 s4 avahi-daemon[1993]: Joining mDNS multicast group on interface lxdbr0.IPv4 with address 10.104.52.1.
Aug 16 11:09:44 s4 avahi-daemon[1993]: New relevant interface lxdbr0.IPv4 for mDNS.
Aug 16 11:09:44 s4 avahi-daemon[1993]: Registering new address record for 10.104.52.1 on lxdbr0.IPv4.
Aug 16 11:09:44 s4 named[2591]: listening on IPv4 interface lxdbr0, 10.104.52.1#53
Aug 16 11:09:44 s4 named[2591]: network unreachable resolving 'ubuntu.com/DS/IN': 2001:503:a83e::2:30#53
Aug 16 11:09:44 s4 named[2591]: network unreachable resolving 'ubuntu.com/DS/IN': 2001:503:eea3::30#53
Aug 16 11:09:44 s4 dnsmasq[25868]: failed to create listening socket for 10.104.52.1: Address already in use
Aug 16 11:09:44 s4 dnsmasq[25868]: FAILED to start up
Aug 16 11:09:45 s4 dnsmasq[25869]: failed to create listening socket for 10.104.52.1: Address already in use
Aug 16 11:09:45 s4 dnsmasq[25869]: FAILED to start up
Aug 16 11:09:45 s4 dnsmasq[25870]: failed to create listening socket for 10.104.52.1: Address already in use
Aug 16 11:09:45 s4 dnsmasq[25870]: FAILED to start up
Aug 16 11:09:46 s4 dnsmasq[25871]: failed to create listening socket for 10.104.52.1: Address already in use
Aug 16 11:09:46 s4 dnsmasq[25871]: FAILED to start up

A partir daqui, insira o loop infinito e nunca inicia

==================== UPDATE 3 ====================== =============

Eu tenho uma máquina física com o erro de loop de reinicialização do endlesse e uma máquina virtual que reinicia corretamente.

Na máquina física (com o erro durante o loop):

sysop@s4:~$ sudo brctl show
bridge name     bridge id               STP enabled     interfaces
lxdbr0          8000.fe049a888031       no              veth7KVBSH
                                                        vethFPOTVD
                                                        vethRA1QON
                                                        vethXPQLPC
                                                        vethYWVLD4
lxdbr1          8000.fe503c909805       no              vethGDM55D
virbr1          8000.525400d8609d       yes             virbr1-nic

Na máquina virtual (que reinicia corretamente):

sysop@vx00:~$ sudo brctl show
[sudo] password di sysop: 
bridge name     bridge id               STP enabled     interfaces
lxdbr0          8000.fe4f7f04c603       no              veth13QLME
                                                        veth8VLGTS
                                                        vethK17EY7
                                                        vethMBSAPN
                                                        vethX7TJ8L
lxdbr1          8000.fec3f10606ce       no              vethOXYX5G
virbr1          8000.fe5400ffa6aa       yes             vnet1

Isso pode ser relevante?

    
por Mirto Busico 15.08.2017 / 20:25

2 respostas

0

Leia a mensagem "falha ao criar o soquete de escuta para 10.104.52.1: Endereço já em uso"

então escolha outro endereço IP, 10.104.52.2 ou algo assim

    
por Panther 15.08.2017 / 20:37
0

Respondendo a mim mesmo RESOLVIDO

Eu instalei o bind9 na mesma máquina e isso tem precedência sobre o dnsmasq

No status do loop infinito:

sysop@s4:~/script$ sudo netstat -anlp | grep -w LISTEN
tcp        0      0 127.0.0.1:5900          0.0.0.0:*               LISTEN      4888/qemu-system-x8
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN      5145/qemu-system-x8
tcp        0      0 127.0.0.1:5902          0.0.0.0:*               LISTEN      5287/qemu-system-x8
tcp        0      0 127.0.0.1:5903          0.0.0.0:*               LISTEN      5457/qemu-system-x8
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      3916/perl       
tcp        0      0 10.0.1.1:53             0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 10.104.52.1:53          0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.66.1:53         0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.33.1:53         0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.99.1:53         0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.13.128:53       0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.1.21:53         0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.1.22:53         0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 192.168.1.20:53         0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2593/sshd       
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      20214/named     
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3910/master     
tcp6       0      0 :::10000                :::*                    LISTEN      3916/perl       
tcp6       0      0 :::53                   :::*                    LISTEN      20214/named     
tcp6       0      0 :::22                   :::*                    LISTEN      2593/sshd       
tcp6       0      0 ::1:953                 :::*                    LISTEN      20214/named     
tcp6       0      0 :::25                   :::*                    LISTEN      3910/master     

Parando bind9 lxc começa corretamente e eu tenho

sysop@s4:~/script$ sudo netstat -anlp | grep -w LISTEN
tcp        0      0 127.0.0.1:5900          0.0.0.0:*               LISTEN      4888/qemu-system-x8
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN      5145/qemu-system-x8
tcp        0      0 127.0.0.1:5902          0.0.0.0:*               LISTEN      5287/qemu-system-x8
tcp        0      0 127.0.0.1:5903          0.0.0.0:*               LISTEN      5457/qemu-system-x8
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      3916/perl       
tcp        0      0 10.0.1.1:53             0.0.0.0:*               LISTEN      20457/dnsmasq   
tcp        0      0 10.104.52.1:53          0.0.0.0:*               LISTEN      20402/dnsmasq   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2593/sshd       
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3910/master     
tcp6       0      0 :::10000                :::*                    LISTEN      3916/perl       
tcp6       0      0 fe80::fc50:3cff:fe90:53 :::*                    LISTEN      20457/dnsmasq   
tcp6       0      0 fe80::20b2:ceff:fe25:53 :::*                    LISTEN      20402/dnsmasq   
tcp6       0      0 :::22                   :::*                    LISTEN      2593/sshd       
tcp6       0      0 :::25                   :::*                    LISTEN      3910/master     
    
por Mirto Busico 16.08.2017 / 12:47