Eu instalei o xrdp em um dos servidores lubuntu 14.04 & criou 40-50 usuários no mesmo servidor para acessar aplicativos específicos por meio do RDP.
Todos os usuários obtêm com êxito o RDP do mstsc.exe (área de trabalho remota do Windows) & usar o aplicativo até certo ponto, mas em algum momento o serviço xrdp se comporta mal & isso acontece muitas vezes, particularmente duas vezes por dia.
Quando eu verifico sudo service xrdp status
, um dos itens abaixo sempre falha, particularmente o Gerenciador de Sessão RDP.
* Checking status of Remote Desktop Protocol server xrdp [ok]
* Checking status of RDP Session Manager sesman [fail]
Geralmente eu tenho que reiniciar o sistema para fazê-lo funcionar para os usuários.
Mesmo se eu reiniciar o serviço xrdp particular ou matar o gerenciador de sessão por sudo xrdp-sesman -k
& reiniciar o serviço xrdp, ele não será iniciado & devido a que os usuários não podem realizar sessões RDP .
Então, como encontrar / quais são as possíveis razões para falha no serviço !!!
EDITAR: Registros adicionados
Abaixo está o log de ambos os /var/log/xrdp.log & /var/log/xrdp-sesman.log
==========================================================================
/var/log/xrdp.log (xrdp log messages)
When xrdp service status was FAILED & users can't take RDP, RDP was Hang ---->
[20180314-12:17:16] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:16] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:17] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:17] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:17:17] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 11
[20180314-12:17:27] [DEBUG] returnvalue from xrdp_mm_connect 0
[20180314-12:17:27] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:27] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:28] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
Continues same above message
[20180314-12:17:56] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:57] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:17:57] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:17:57] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 11
[20180314-12:18:04] [DEBUG] returnvalue from xrdp_mm_connect 0
[20180314-12:18:48] [INFO ] An established connection closed to endpoint: XXX.XX.XX.X:YYYYY - socket: 8
[20180314-12:18:48] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:18:48] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 11
[20180314-12:18:48] [ERROR] Listening socket is in wrong state we terminate listener
[20180314-12:19:42] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XX.XXX.XX:YYYYY - socket: 8
[20180314-12:19:43] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 12
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 13
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XX.XX.X:YYYYY - socket: 8
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XXX.XX:YYYYY - socket: 8
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XXX.XX:YYYYY - socket: 8
[20180314-12:19:43] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XX.XX.XX:YYYYY - socket: 8
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.X.XX.XX:YYYYY - socket: 8
[20180314-12:19:43] [ERROR] Listening socket is in wrong state we terminate listener
[20180314-12:19:43] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:19:43] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 12
[20180314-12:19:43] [ERROR] Listening socket is in wrong state we terminate listener
[20180314-12:19:43] [ERROR] Listening socket is in wrong state we terminate listener
[20180314-12:19:43] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:19:43] [DEBUG] xrdp_mm_module_cleanup
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 13
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 12
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 12
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 13
[20180314-12:19:43] [ERROR] Listening socket is in wrong state we terminate listener
[20180314-12:19:43] [INFO ] An established connection closed to endpoint: XXX.XXX.XX.XX:YYYYY - socket: 13
[20180314-12:19:43] [ERROR] Listening socket is in wrong state we terminate listener
[20180314-12:19:43] [ERROR] Listening socket is in wrong state we terminate listener
Manually done system reboot
After reboot xrdp service status was OK & users can take RDP ---->
[20180314-12:21:06] [INFO ] A connection received from: XXX.XX.XX.X port YYYYY
[20180314-12:21:06] [INFO ] An established connection closed to endpoint: XXX.XX.XX.X:YYYYY - socket: 8
[20180314-12:21:06] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20180314-12:21:06] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/cert.pem
[20180314-12:21:06] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/key.pem
[20180314-12:21:06] [DEBUG] xrdp_0000152e_wm_login_mode_event_00000001
[20180314-12:21:06] [WARN ] local keymap file for 0x0409 found and dosen't match built in keymap, using local keymap file
[20180314-12:21:12] [DEBUG] returnvalue from xrdp_mm_connect 0
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20180314-12:21:12] [INFO ] lib_mod_log_peer: xrdp_pid=5422 connected to X11rdp_pid=5763 X11rdp_uid=1007 X11rdp_gid=1007 client_ip=XXX.XX.XX.X client_port=YYYYY
[20180314-12:21:12] [DEBUG] xrdp_mm_connect_chansrv: chansrvconnect successful
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 11
[20180314-12:21:13] [INFO ] The following channel is allowed: cliprdr (0)
[20180314-12:21:13] [INFO ] The following channel is allowed: rdpdr (1)
[20180314-12:21:13] [DEBUG] The allow channel list now initialized for this session
==========================================================================
/var/log/xrdp-sesman.log (Sesman log Messages)
When xrdp service status was FAILED & users can't take RDP, RDP was Hang---->
[20180314-12:17:27] [INFO ] A connection received from: 127.0.0.1 port 47441
[20180314-12:17:27] [INFO ] scp thread on sck 8 started successfully
[20180314-12:17:27] [INFO ] ++ reconnected session: username XXXXXX, display :15.0, session_pid 23908, ip XXX.XX.XX.X:YYYYY - socket: 8
[20180314-12:17:27] [INFO ] An established connection closed to endpoint: 127.0.0.1:47441 - socket: 8
[20180314-12:17:42] [INFO ] shutting down sesman 1
[20180314-12:17:42] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20180314-12:17:42] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20180314-12:17:51] [WARN ] [init:46] libscp initialized
[20180314-12:17:51] [CORE ] starting sesman with pid 16164
[20180314-12:17:51] [INFO ] listening...
[20180314-12:17:51] [ERROR] bind error on port '3350': 98 (Address already in use)
[20180314-12:17:51] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20180314-12:19:43] [INFO ] shutting down sesman 1
[20180314-12:19:43] [INFO ] shutting down sesman 1
[20180314-12:19:43] [INFO ] shutting down sesman 1
[20180314-12:19:43] [INFO ] shutting down sesman 1
Manually done system reboot
After reboot xrdp service status was OK & users can take RDP ---->
[20180314-12:20:36] [WARN ] [init:46] libscp initialized
[20180314-12:20:36] [CORE ] starting sesman with pid 2896
[20180314-12:20:36] [INFO ] listening...
[20180314-12:21:12] [INFO ] A connection received from: 127.0.0.1 port 52106
[20180314-12:21:12] [INFO ] scp thread on sck 8 started successfully
[20180314-12:21:12] [INFO ] ++ created session (access granted): username XXXXXX, ip XXX.XX.XX.X:38916 - socket: 8
[20180314-12:21:12] [INFO ] starting X11rdp session...
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: 127.0.0.1:52106 - socket: 8
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20180314-12:21:12] [INFO ] An established connection closed to endpoint: 127.0.0.1:52106 - socket: 8
[20180314-12:21:12] [INFO ] X11rdp :11 -geometry 800x600 -depth 24 -bs -ac -nolisten tcp -uds -once
[20180314-12:21:12] [INFO ] starting xrdp-sessvc - xpid=5763 - wmpid=5762
==========================================================================