Não é possível iniciar aplicativos devido ao erro "Número máximo de clientes atingidos"

4

Depois de algum tempo, estou com problemas para iniciar aplicativos, por exemplo, o Viber.

$ /opt/viber/Viber
QSqlDatabasePrivate::removeDatabase: connection 'ConfigureDBConnection' is still in use, all queries will cease to work.
Maximum number of clients reached
(Viber:1279): Gtk-WARNING **: cannot open display: :0

Skype

$ skype
Maximum number of clients reached

Gnote

$ gnote
Maximum number of clients reached
** (gnote:21284): WARNING **: Could not open X display
Maximum number of clients reached
(gnote:21284): Gtk-WARNING **: cannot open display: :0

xrestop

$ xrestop
Maximum number of clients reachedxrestop: Unable to open display!

Após algumas pesquisas, descobri que está relacionado a algum limite de soquetes unix.

$ lsof -U +c 15 | wc -l
1011


$ lsof -U +c 15 | cut -f1 -d' ' | sort | uniq -c | sort -rn | head -3
    382 zenity
    256 dbus-daemon
    212 chrome

Em algumas fontes, as pessoas estão falando sobre um limite máximo de 256 X clientes. Parece que isso é provado pela seguinte saída de comando:

# lsof -p 'pidof X' | tail -n 50
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Xorg    1672 root  207u     unix 0xffff880141189e00      0t0    3759941 @/tmp/.X11-unix/X0
Xorg    1672 root  208u     unix 0xffff88001a50a940      0t0    3759944 @/tmp/.X11-unix/X0
Xorg    1672 root  209u     unix 0xffff88003a0430c0      0t0    3802123 @/tmp/.X11-unix/X0
Xorg    1672 root  210u     unix 0xffff8801117c3c00      0t0    3817272 @/tmp/.X11-unix/X0
Xorg    1672 root  211u     unix 0xffff8801225e2580      0t0    4395710 @/tmp/.X11-unix/X0
Xorg    1672 root  212u     unix 0xffff88015ed3a580      0t0    4425629 @/tmp/.X11-unix/X0
Xorg    1672 root  213u     unix 0xffff88013095f800      0t0    4427059 @/tmp/.X11-unix/X0
Xorg    1672 root  214u     unix 0xffff8802e75d9a40      0t0    4427075 @/tmp/.X11-unix/X0
Xorg    1672 root  215u     unix 0xffff8801225e12c0      0t0    4608310 @/tmp/.X11-unix/X0
Xorg    1672 root  216u     unix 0xffff88031bc8fbc0      0t0    4608314 @/tmp/.X11-unix/X0
Xorg    1672 root  217u     unix 0xffff8801309a5dc0      0t0    4608318 @/tmp/.X11-unix/X0
Xorg    1672 root  218u     unix 0xffff8801309a2940      0t0    4607747 @/tmp/.X11-unix/X0
Xorg    1672 root  219u     unix 0xffff880130958b40      0t0    4786413 @/tmp/.X11-unix/X0
Xorg    1672 root  220u     unix 0xffff8800b1382d00      0t0    4787103 @/tmp/.X11-unix/X0
Xorg    1672 root  221u     unix 0xffff88011f350000      0t0    5001136 @/tmp/.X11-unix/X0
Xorg    1672 root  222u     unix 0xffff88011f352d00      0t0    5144089 @/tmp/.X11-unix/X0
Xorg    1672 root  223u     unix 0xffff88011f351a40      0t0    5144417 @/tmp/.X11-unix/X0
Xorg    1672 root  224u     unix 0xffff88011f357bc0      0t0    5145648 @/tmp/.X11-unix/X0
Xorg    1672 root  225u     unix 0xffff88014108a940      0t0    5145652 @/tmp/.X11-unix/X0
Xorg    1672 root  226u     unix 0xffff88001a50c740      0t0    5145655 @/tmp/.X11-unix/X0
Xorg    1672 root  227u     unix 0xffff88006c7b6cc0      0t0    5161703 @/tmp/.X11-unix/X0
Xorg    1672 root  228u     unix 0xffff8802e75dddc0      0t0    5225428 @/tmp/.X11-unix/X0
Xorg    1672 root  229u     unix 0xffff88015ed3cb00      0t0    5228455 @/tmp/.X11-unix/X0
Xorg    1672 root  230u     unix 0xffff880111b203c0      0t0    5235401 @/tmp/.X11-unix/X0
Xorg    1672 root  231u     unix 0xffff88013089bfc0      0t0    5259828 @/tmp/.X11-unix/X0
Xorg    1672 root  232u     unix 0xffff8800b10030c0      0t0    5310616 @/tmp/.X11-unix/X0
Xorg    1672 root  233u     unix 0xffff88010d461e00      0t0    5349971 @/tmp/.X11-unix/X0
Xorg    1672 root  234u     unix 0xffff88001a50ddc0      0t0    5530781 @/tmp/.X11-unix/X0
Xorg    1672 root  235u     unix 0xffff880142e703c0      0t0    5529146 @/tmp/.X11-unix/X0
Xorg    1672 root  236u     unix 0xffff880142e73c00      0t0    5654363 @/tmp/.X11-unix/X0
Xorg    1672 root  237u     unix 0xffff88025087f800      0t0    5260838 @/tmp/.X11-unix/X0
Xorg    1672 root  238u     unix 0xffff880142e712c0      0t0    5814164 @/tmp/.X11-unix/X0
Xorg    1672 root  239u     unix 0xffff8802508a21c0      0t0    5917312 @/tmp/.X11-unix/X0
Xorg    1672 root  240u     unix 0xffff8800b1387080      0t0    5851281 @/tmp/.X11-unix/X0
Xorg    1672 root  241u     unix 0xffff8802e6854380      0t0    5851284 @/tmp/.X11-unix/X0
Xorg    1672 root  242u     unix 0xffff88011f3503c0      0t0    5851295 @/tmp/.X11-unix/X0
Xorg    1672 root  243u     unix 0xffff8801041d8f00      0t0    5917315 @/tmp/.X11-unix/X0
Xorg    1672 root  244u     unix 0xffff8801041d83c0      0t0    5917322 @/tmp/.X11-unix/X0
Xorg    1672 root  245u     unix 0xffff88000aeb4ec0      0t0    5917325 @/tmp/.X11-unix/X0
Xorg    1672 root  246u     unix 0xffff880111b21e00      0t0    5993474 @/tmp/.X11-unix/X0
Xorg    1672 root  247u     unix 0xffff880143546180      0t0    6115119 @/tmp/.X11-unix/X0
Xorg    1672 root  248u     unix 0xffff88000aeb30c0      0t0    6120777 @/tmp/.X11-unix/X0
Xorg    1672 root  249u     unix 0xffff88013089da00      0t0    6119223 @/tmp/.X11-unix/X0
Xorg    1672 root  250u     unix 0xffff8801309a5280      0t0    6121614 @/tmp/.X11-unix/X0
Xorg    1672 root  251u     unix 0xffff88000aeb6cc0      0t0    6139354 @/tmp/.X11-unix/X0
Xorg    1672 root  252u     unix 0xffff88010d460000      0t0    6635385 @/tmp/.X11-unix/X0
Xorg    1672 root  253u     unix 0xffff88013095b840      0t0    6659213 @/tmp/.X11-unix/X0
Xorg    1672 root  254u     unix 0xffff88005c96b480      0t0    6661835 @/tmp/.X11-unix/X0
Xorg    1672 root  255u     unix 0xffff88011f350f00      0t0    6710815 @/tmp/.X11-unix/X0
Xorg    1672 root  256u      REG               0,16     4096      22306 /sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-LVDS-1/intel_backlight/brightness

Eu posso fechar um aplicativo, por exemplo, o Chrome e depois o Viber pode ser iniciado.

Gostaria de saber se é normal ter mais de 200 conexões para os três principais aplicativos? Ou apenas sugerir como resolver o problema, por favor.

Note que posso usar meu sistema por meses sem reinicializar (suspender / retomar).

Linux Mint 17,3 canela de 64 bits

    
por gumkins 30.05.2017 / 06:43

1 resposta

4

Eu descobri como consertá-lo na situação.

O seguinte comando fez uma sugestão para mim

$ lsof -U +c 15 | cut -f1 -d' ' | sort | uniq -c | sort -rn | head -3
    382 zenity
    256 dbus-daemon
    212 chrome

Eu peguei o nome do processo e li pouco sobre isso. Da Wikipedia

Zenity is free software and a cross-platform program that allows the execution of GTK+ dialog boxes in command-line and shell scripts.

Em seguida, listei processos e os filtrei por zenity key

$ ps axwwu | grep -i zenity
tom       762  0.0  0.2 390752 27476 ?        Sl   Jun06   0:01 /usr/bin/zenity --notification --window-icon /usr/share/icons/gnome/32x32/status/mail-unread.png --text You have new mail
tom      1239  0.0  0.2 390756 27700 ?        Sl   Jun06   0:01 /usr/bin/zenity --notification --window-icon /usr/share/icons/gnome/32x32/status/mail-unread.png --text You have new mail
tom      1249  0.0  0.2 390760 27752 ?        Sl   Jun02   0:01 /usr/bin/zenity --notification --window-icon /usr/share/icons/gnome/32x32/status/mail-unread.png --text You have new mail
...

Aha! Isso está relacionado aos brindes de notificação por e-mail

$ pidof zenity | wc -w
186

$ killall zenity

$ pidof zenity | wc -w
0

$ lsof -U +c 15 | cut -f1 -d' ' | sort | uniq -c | sort -rn | head -3
    140 chrome
     61 dbus-daemon
     37 skypeforlinux

# lsof -p 'pidof X' | tail -n 10
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Xorg    1672 root   58u     unix 0xffff8801c05221c0      0t0    9714900 @/tmp/.X11-unix/X0
Xorg    1672 root   59u     unix 0xffff8801c0527440      0t0    9715809 @/tmp/.X11-unix/X0
Xorg    1672 root   62u      CHR              13,79      0t0    9540231 /dev/input/event15
Xorg    1672 root   69u     unix 0xffff88031c155280      0t0     175280 @/tmp/.X11-unix/X0
Xorg    1672 root   79u     unix 0xffff880063b103c0      0t0    9243076 @/tmp/.X11-unix/X0
Xorg    1672 root   90u     unix 0xffff880111b22940      0t0    2858278 @/tmp/.X11-unix/X0
Xorg    1672 root   96u     unix 0xffff88000aeb2d00      0t0    9301134 @/tmp/.X11-unix/X0
Xorg    1672 root  113u     unix 0xffff880063b14b00      0t0     939782 @/tmp/.X11-unix/X0
Xorg    1672 root  153u     unix 0xffff880111a47080      0t0    1819503 @/tmp/.X11-unix/X0
Xorg    1672 root  256u      REG               0,16     4096      22306 /sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-LVDS-1/intel_backlight/brightness

# lsof -p 'pidof X' | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
524

Voilà! Eu posso iniciar outros aplicativos agora (até que o zenity ou outro aplicativo com bugs consuma todas as conexões disponíveis).

NOTA. Eu ainda terei que classificar como evitar que o zenity mantenha conexões

    
por 18.06.2017 / 15:36