Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xrdp-sesman won't start #2816

Closed
tiapfy opened this issue Oct 5, 2023 · 22 comments
Closed

xrdp-sesman won't start #2816

tiapfy opened this issue Oct 5, 2023 · 22 comments
Labels

Comments

@tiapfy
Copy link

tiapfy commented Oct 5, 2023

xrdp version

0.9.12-1

Detailed xrdp version, build options

The log reference is NULL - log not initialized properly
xrdp 0.9.12
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2018 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --enable-ipv6
      --enable-jpeg
      --enable-fuse
      --enable-rfxcodec
      --enable-opus
      --enable-painter
      --enable-vsock
      --build=x86_64-linux-gnu
      --prefix=/usr
      --includedir=${prefix}/include
      --mandir=${prefix}/share/man
      --infodir=${prefix}/share/info
      --sysconfdir=/etc
      --localstatedir=/var
      --disable-silent-rules
      --libdir=${prefix}/lib/x86_64-linux-gnu
      --libexecdir=${prefix}/lib/x86_64-linux-gnu
      --disable-maintainer-mode
      --disable-dependency-tracking
      --with-socketdir=/run/xrdp/sockdir
      build_alias=x86_64-linux-gnu
      CFLAGS=-g -O2 -fdebug-prefix-map=/build/xrdp-GJgww4/xrdp-0.9.12=. -fstack-protector-strong -Wformat -Werror=format-security
      LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed
      CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2
      PKG_CONFIG_PATH=/build/xrdp-GJgww4/xrdp-0.9.12/pkgconfig

  Compiled with OpenSSL 1.1.1f  31 Mar 2020

Operating system & version

Ubuntu 20.04

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

No response

What desktop environment do you use?

GNOME

Environment xrdp running on

VM

What's your client?

No response

Area(s) with issue?

Session manager (sesman)

Steps to reproduce

I've installed xrdp on a VPS a year ago and it worked well until 2 days ago (according to the logs), when it received a SIGHUP and shut down. Today I tried to connect and couldn't. I found the logs I just mentioned and started trying to fix the problem. Trying to start it manually with "sudo systemctl start xrdp" didn't work, saying "A dependency job for xrdp.service failed", which, according to other posts, means that xrdp-sesman is having a problem. At some point I uninstalled everything and in doing so I lost the original logs. Now I have reinstalled everything and it seems that sesman is still incapable of starting. I'm still pretty unexperienced with Ubuntu so I probably missed something obvious or didn't understand some of the posts I read.

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Anything else?

xrdp-sesman.log
xrdp.log is empty
xorg.conf is missing

@tiapfy tiapfy added the bug label Oct 5, 2023
@matt335672
Copy link
Member

Hi @tiapfy

This sort of thing has been reported a couple of times now (#2750, #2752) and as yet we have not found a resolution I am happy with.

What do you get for these commands?

sudo systemctl status xrdp xrdp-sesman
sudo journalctl -u xrdp-sesman --lines=50
sudo ss -lp sport = 3350

Being inexperienced with Ubuntu is fine - we've all been there! For reference these commands output the status of the two services, generate a system log for xrdp-sesman and see what is currently listening on port 3350.

Thanks

@tiapfy
Copy link
Author

tiapfy commented Oct 6, 2023

Hi @tiapfy

This sort of thing has been reported a couple of times now (#2750, #2752) and as yet we have not found a resolution I am happy with.

What do you get for these commands?

sudo systemctl status xrdp xrdp-sesman
sudo journalctl -u xrdp-sesman --lines=50
sudo ss -lp sport = 3350

Being inexperienced with Ubuntu is fine - we've all been there! For reference these commands output the status of the two services, generate a system log for xrdp-sesman and see what is currently listening on port 3350.

Thanks

From
sudo systemctl status xrdp xrdp-sesman
I get:

● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: >
     Active: inactive (dead)
       Docs: man:xrdp(8)
             man:xrdp.ini(5)

ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[I>
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[D>
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[D>
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[D>
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[D>
ott 03 04:41:39 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] >
ott 03 04:41:39 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] >
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[D>
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[I>
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[I>
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[D>
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[D>
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[D>
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[D>
ott 03 04:41:40 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] >
ott 03 04:41:40 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] >
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[D>
lines 1-23...skipping...
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:xrdp(8)
             man:xrdp.ini(5)

ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[DEBUG] TLSv1.3 enabled
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[DEBUG] TLSv1.2 enabled
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[DEBUG] Security layer: requested 3, selected 1
ott 03 04:41:33 autoapi.servereasy.it xrdp[511627]: (511627)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:39 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] Socket 12: AF_INET6 connection received from ::ffff:78.135.85.12 port 50149
ott 03 04:41:39 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[DEBUG] TLSv1.3 enabled
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[DEBUG] TLSv1.2 enabled
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[DEBUG] Security layer: requested 3, selected 1
ott 03 04:41:39 autoapi.servereasy.it xrdp[511628]: (511628)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:40 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] Socket 12: AF_INET6 connection received from ::ffff:78.135.85.12 port 50861
ott 03 04:41:40 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[DEBUG] TLSv1.3 enabled
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[DEBUG] TLSv1.2 enabled
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[DEBUG] Security layer: requested 3, selected 1
ott 03 04:41:40 autoapi.servereasy.it xrdp[511631]: (511631)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:45 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] Socket 12: AF_INET6 connection received from ::ffff:78.135.85.12 port 52534
ott 03 04:41:45 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[DEBUG] TLSv1.3 enabled
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[DEBUG] TLSv1.2 enabled
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[DEBUG] Security layer: requested 3, selected 1
ott 03 04:41:45 autoapi.servereasy.it xrdp[511632]: (511632)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:47 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] Socket 12: AF_INET6 connection received from ::ffff:78.135.85.12 port 53643
ott 03 04:41:47 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[DEBUG] TLSv1.3 enabled
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[DEBUG] TLSv1.2 enabled
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[DEBUG] Security layer: requested 3, selected 1
ott 03 04:41:47 autoapi.servereasy.it xrdp[511633]: (511633)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:52 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] Socket 12: AF_INET6 connection received from ::ffff:78.135.85.12 port 55251
ott 03 04:41:52 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[DEBUG] TLSv1.3 enabled
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[DEBUG] TLSv1.2 enabled
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[DEBUG] Security layer: requested 3, selected 1
ott 03 04:41:52 autoapi.servereasy.it xrdp[511634]: (511634)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:53 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[INFO ] Socket 12: AF_INET6 connection received from ::ffff:78.135.85.12 port 55951
ott 03 04:41:53 autoapi.servereasy.it xrdp[490]: (490)(140124204390208)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:185.25.206.69 port 3389)
ott 03 04:41:53 autoapi.servereasy.it xrdp[511635]: (511635)(140124204390208)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
ott 03 04:41:53 autoapi.servereasy.it xrdp[511635]: (511635)(140124204390208)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
ott 03 04:41:53 autoapi.servereasy.it xrdp[511635]: (511635)(140124204390208)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
ott 03 04:41:53 autoapi.servereasy.it xrdp[511635]: (511635)(140124204390208)[DEBUG] TLSv1.3 enabled
lines 1-62

From
sudo journalctl -u xrdp-sesman --lines=50
I get:

-- Logs begin at Tue 2023-10-03 00:15:03 CEST, end at Fri 2023-10-06 16:07:42 CEST. --
ott 05 17:05:43 autoapi.servereasy.it systemd[1]: Starting xrdp session manager...
ott 05 17:05:43 autoapi.servereasy.it xrdp-sesman[408]: (408)(140323401242176)[DEBUG] libscp initialized
ott 05 17:05:43 autoapi.servereasy.it xrdp-sesman[408]: (408)(140323401242176)[DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
ott 05 17:05:43 autoapi.servereasy.it xrdp-sesman[408]: (408)(140323401242176)[DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
ott 05 17:05:43 autoapi.servereasy.it xrdp-sesman[411]: (411)(140323401242176)[INFO ] starting xrdp-sesman with pid 411
ott 05 17:05:43 autoapi.servereasy.it xrdp-sesman[411]: (411)(140323401242176)[INFO ] listening to port 3350 on 127.0.0.1
ott 05 17:05:43 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Can't open PID file /run/xrdp/xrdp-sesman.pid (yet?) after start: Operation not permitted
ott 05 17:07:13 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: start operation timed out. Terminating.
ott 05 17:07:13 autoapi.servereasy.it xrdp-sesman[411]: (411)(140323401242176)[INFO ] shutting down sesman 1
ott 05 17:07:13 autoapi.servereasy.it xrdp-sesman[411]: (411)(140323401242176)[DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
ott 05 17:07:13 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Failed with result 'timeout'.
ott 05 17:07:13 autoapi.servereasy.it systemd[1]: Failed to start xrdp session manager.
ott 05 17:07:48 autoapi.servereasy.it systemd[1]: Starting xrdp session manager...
ott 05 17:07:48 autoapi.servereasy.it xrdp-sesman[992]: (992)(140611469080128)[DEBUG] libscp initialized
ott 05 17:07:48 autoapi.servereasy.it xrdp-sesman[992]: (992)(140611469080128)[DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
ott 05 17:07:48 autoapi.servereasy.it xrdp-sesman[992]: (992)(140611469080128)[DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
ott 05 17:07:48 autoapi.servereasy.it xrdp-sesman[993]: (993)(140611469080128)[INFO ] starting xrdp-sesman with pid 993
ott 05 17:07:48 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Can't open PID file /run/xrdp/xrdp-sesman.pid (yet?) after start: Operation not permitted
ott 05 17:07:48 autoapi.servereasy.it xrdp-sesman[993]: (993)(140611469080128)[INFO ] listening to port 3350 on 127.0.0.1
ott 05 17:09:18 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: start operation timed out. Terminating.
ott 05 17:09:18 autoapi.servereasy.it xrdp-sesman[993]: (993)(140611469080128)[INFO ] shutting down sesman 1
ott 05 17:09:18 autoapi.servereasy.it xrdp-sesman[993]: (993)(140611469080128)[DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
ott 05 17:09:18 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Failed with result 'timeout'.
ott 05 17:09:18 autoapi.servereasy.it systemd[1]: Failed to start xrdp session manager.
ott 03 11:26:43 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[INFO ] A connection received from ::1 port 52950
ott 03 11:26:43 autoapi.servereasy.it xrdp-sesman[472]: pam_unix(xrdp-sesman:auth): check pass; user unknown
ott 03 11:26:43 autoapi.servereasy.it xrdp-sesman[472]: pam_unix(xrdp-sesman:auth): authentication failure; logname= uid=0 euid=0 tty=xrdp-sesman ruser= rhost=
ott 03 11:26:45 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
ott 03 15:52:23 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[INFO ] A connection received from ::1 port 44404
ott 03 15:52:23 autoapi.servereasy.it xrdp-sesman[472]: pam_unix(xrdp-sesman:auth): check pass; user unknown
ott 03 15:52:23 autoapi.servereasy.it xrdp-sesman[472]: pam_unix(xrdp-sesman:auth): authentication failure; logname= uid=0 euid=0 tty=xrdp-sesman ruser= rhost=
ott 03 15:52:25 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
ott 03 16:41:00 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[INFO ] A connection received from ::1 port 44556
ott 03 16:41:00 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[INFO ] ++ reconnected session: username exa, display :10.0, session_pid 43826, ip ::ffff:79.30.179.128:58544 - socket: 12
ott 03 16:41:00 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
ott 03 16:47:49 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[INFO ] ++ terminated session:  username exa, display :10.0, session_pid 43826, ip ::ffff:109.52.206.213:55455 - socket: 12
ott 03 16:47:51 autoapi.servereasy.it systemd[1]: Stopping xrdp session manager...
ott 03 16:47:51 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Control process exited, code=exited, status=1/FAILURE
ott 03 16:47:51 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[INFO ] shutting down sesman 1
ott 03 16:47:51 autoapi.servereasy.it xrdp-sesman[472]: (472)(140452812457536)[DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
ott 03 16:47:51 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Failed with result 'exit-code'.
ott 03 16:47:56 autoapi.servereasy.it systemd[1]: Stopped xrdp session manager.
ott 03 16:48:07 autoapi.servereasy.it systemd[1]: Starting xrdp session manager...
ott 03 16:48:07 autoapi.servereasy.it xrdp-sesman[432]: (432)(139628146136640)[DEBUG] libscp initialized
ott 03 16:48:07 autoapi.servereasy.it xrdp-sesman[432]: (432)(139628146136640)[DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
ott 03 16:48:07 autoapi.servereasy.it xrdp-sesman[432]: (432)(139628146136640)[DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
ott 03 16:48:07 autoapi.servereasy.it xrdp-sesman[436]: (436)(139628146136640)[ERROR] error opening pid file[/var/run/xrdp/xrdp-sesman.pid]: No such file or directory
ott 03 16:48:07 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Can't open PID file /run/xrdp/xrdp-sesman.pid (yet?) after start: Operation not permitted
ott 03 16:48:07 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Failed with result 'protocol'.
ott 03 16:48:07 autoapi.servereasy.it systemd[1]: Failed to start xrdp session manager.

From
sudo ss -lp sport = 3350
I get:

RTNETLINK answers: Invalid argument
Netid                   State                   Recv-Q                   Send-Q                                       Local Address:Port                                       Peer Address:Port                   Process

Just to be clear, the last one says Invalid argument but I pasted exactly what you wrote.

@matt335672
Copy link
Member

Interesting.

According to the v0.9.12 sources, sesman will create a PID file in ${localstatedir}/run/xrdp-sesman.pid, where ${localstatedir} appears to be /var in your setup.

However, systemd is looking for a PID file in /run/xrdp/xrdp-sesman.pid :-

ott 03 16:48:07 autoapi.servereasy.it xrdp-sesman[436]: (436)(139628146136640)[ERROR] error opening pid file[/var/run/xrdp/xrdp-sesman.pid]: No such file or directory

What do you get for these commands:-

ls -ld /var/run
sudo xrdp-sesman -k
systemctl cat xrdp-sesman.service

@tiapfy
Copy link
Author

tiapfy commented Oct 7, 2023

Here are the outputs:

drwxr-xr-x 7 root root 4096 ott  7 19:57 /var/run
sesman is not running (pid file not found - /var/run/xrdp/xrdp-sesman.pid)
# /lib/systemd/system/xrdp-sesman.service
[Unit]
Description=xrdp session manager
Documentation=man:xrdp-sesman(8) man:sesman.ini(5)
After=network.target
StopWhenUnneeded=true
BindsTo=xrdp.service

[Service]
Type=forking
PIDFile=/run/xrdp/xrdp-sesman.pid
RuntimeDirectory=xrdp
EnvironmentFile=-/etc/sysconfig/xrdp
EnvironmentFile=-/etc/default/xrdp
ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
ExecStop=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS --kill

[Install]
WantedBy=multi-user.target

@matt335672
Copy link
Member

The problem seems to be that your /var/run isn't a symlink to /run. That seems to be the normal way that an Ubuntu 20.04 system is configured. I've looked on 18.04, 20.04 and 22.04 here.

I can't see any installation option that would cause these two locations to differ. Is there some local change you've made that may have caused this, or am I misunderstanding an Ubuntu installation option?

Also,
The fix is to get systemd and xrdp-sesman to agree where the PID file lives. At the moment I'm not sure what the best way to do this is.

@tiapfy
Copy link
Author

tiapfy commented Oct 9, 2023

I didn't use any strange installation option consciously, because then it wouldn't have worked from the start, right? From what I gathered the last time someone used the remote desktop the python script we use everytime was started. All it does is start steamcmd and look for updates to the installed game. It never caused problems before this. A couple of weeks back I installed something through apt but ended up never using it and the problem appeared only later. I also installed some updates to Ubuntu at that time.

@matt335672
Copy link
Member

I suspect at some point /var/run has been removed and re-created as a separate directory.

The symlink is created when the base-files package is installed. We can try re-creating it, but this could be pretty disruptive as it's system wide. I think it's only worth doing this if other things are clearly broken.

A simple thing to try is this.

  1. Take a backup of the existing sesman configuration with:-

    sudo cp /lib/systemd/system/xrdp-sesman.service /root/xrdp-sesman.service.old
    
  2. Edit /lib/systemd/system/xrdp-sesman.service. Replace PIDFile=/run/xrdp/xrdp-sesman.pid with PIDFile=/var/run/xrdp/xrdp-sesman.pid

  3. sudo systemctl daemon-reload

That will only affect xrdp. See if it fixes your problem.

@tiapfy
Copy link
Author

tiapfy commented Oct 9, 2023

Ok, it failed again:

2023-10-09 17:33:10 exa:~$ sudo systemctl status xrdp-sesman
● xrdp-sesman.service - xrdp session manager
     Loaded: loaded (/lib/systemd/system/xrdp-sesman.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout) since Mon 2023-10-09 17:31:03 CEST; 2min 7s ago
       Docs: man:xrdp-sesman(8)
             man:sesman.ini(5)
    Process: 146799 ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS (code=exited, status=0/SUCCESS)

ott 09 17:29:33 autoapi.servereasy.it xrdp-sesman[146799]: (146799)(140356077680192)[DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
ott 09 17:29:33 autoapi.servereasy.it xrdp-sesman[146799]: (146799)(140356077680192)[DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
ott 09 17:29:33 autoapi.servereasy.it xrdp-sesman[146800]: (146800)(140356077680192)[INFO ] starting xrdp-sesman with pid 146800
ott 09 17:29:33 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Can't open PID file /run/xrdp/xrdp-sesman.pid (yet?) after start: Operation not permitted
ott 09 17:29:33 autoapi.servereasy.it xrdp-sesman[146800]: (146800)(140356077680192)[INFO ] listening to port 3350 on 127.0.0.1
ott 09 17:31:03 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: start operation timed out. Terminating.
ott 09 17:31:03 autoapi.servereasy.it xrdp-sesman[146800]: (146800)(140356077680192)[INFO ] shutting down sesman 1
ott 09 17:31:03 autoapi.servereasy.it xrdp-sesman[146800]: (146800)(140356077680192)[DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
ott 09 17:31:03 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Failed with result 'timeout'.
ott 09 17:31:03 autoapi.servereasy.it systemd[1]: Failed to start xrdp session manager.

xrdp-sesman.log:

[20231009-17:29:33] [DEBUG] libscp initialized
[20231009-17:29:33] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20231009-17:29:33] [DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
[20231009-17:29:33] [INFO ] starting xrdp-sesman with pid 146800
[20231009-17:29:33] [INFO ] listening to port 3350 on 127.0.0.1
[20231009-17:31:03] [INFO ] shutting down sesman 1
[20231009-17:31:03] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)

@matt335672
Copy link
Member

The edit hasn't worked. It's in the error message:-

ott 09 17:29:33 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Can't open PID file /run/xrdp/xrdp-sesman.pid (yet?) after start: Operation not permitted

Check it's happened with systemctl cat xrdp-sesman.service, then reboot.

@tiapfy
Copy link
Author

tiapfy commented Oct 9, 2023

The edit seems to be correct:

# /lib/systemd/system/xrdp-sesman.service
[Unit]
Description=xrdp session manager
Documentation=man:xrdp-sesman(8) man:sesman.ini(5)
After=network.target
StopWhenUnneeded=true
BindsTo=xrdp.service

[Service]
Type=forking
PIDFile=/var/run/xrdp/xrdp-sesman.pid
RuntimeDirectory=xrdp
EnvironmentFile=-/etc/sysconfig/xrdp
EnvironmentFile=-/etc/default/xrdp
ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
ExecStop=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS --kill

[Install]
WantedBy=multi-user.target

I rebooted but it still doesn't work:

[20231009-18:22:05] [DEBUG] libscp initialized
[20231009-18:22:05] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20231009-18:22:05] [DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
[20231009-18:22:05] [INFO ] starting xrdp-sesman with pid 414
[20231009-18:22:05] [INFO ] listening to port 3350 on 127.0.0.1
[20231009-18:23:36] [INFO ] shutting down sesman 1
[20231009-18:23:36] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
[20231009-18:26:42] [DEBUG] libscp initialized
[20231009-18:26:42] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20231009-18:26:42] [DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
[20231009-18:26:42] [INFO ] starting xrdp-sesman with pid 1116
[20231009-18:26:42] [INFO ] listening to port 3350 on 127.0.0.1
[20231009-18:28:12] [INFO ] shutting down sesman 1
[20231009-18:28:12] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)

2023-10-09 18:39:13 exa:~$ sudo systemctl status xrdp-sesman
● xrdp-sesman.service - xrdp session manager
     Loaded: loaded (/lib/systemd/system/xrdp-sesman.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout) since Mon 2023-10-09 18:28:12 CEST; 11min ago
       Docs: man:xrdp-sesman(8)
             man:sesman.ini(5)
    Process: 1115 ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS (code=exited, status=0/SUCCESS)

ott 09 18:26:42 autoapi.servereasy.it xrdp-sesman[1115]: (1115)(139790486480448)[DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
ott 09 18:26:42 autoapi.servereasy.it xrdp-sesman[1115]: (1115)(139790486480448)[DEBUG] Closed socket 5 (AF_INET6 ::1 port 3350)
ott 09 18:26:42 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Can't open PID file /run/xrdp/xrdp-sesman.pid (yet?) after start: Operation not permitted
ott 09 18:26:42 autoapi.servereasy.it xrdp-sesman[1116]: (1116)(139790486480448)[INFO ] starting xrdp-sesman with pid 1116
ott 09 18:26:42 autoapi.servereasy.it xrdp-sesman[1116]: (1116)(139790486480448)[INFO ] listening to port 3350 on 127.0.0.1
ott 09 18:28:12 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: start operation timed out. Terminating.
ott 09 18:28:12 autoapi.servereasy.it xrdp-sesman[1116]: (1116)(139790486480448)[INFO ] shutting down sesman 1
ott 09 18:28:12 autoapi.servereasy.it xrdp-sesman[1116]: (1116)(139790486480448)[DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
ott 09 18:28:12 autoapi.servereasy.it systemd[1]: xrdp-sesman.service: Failed with result 'timeout'.
ott 09 18:28:12 autoapi.servereasy.it systemd[1]: Failed to start xrdp session manager.

@matt335672
Copy link
Member

Interesting.

Can we just check those areas are currently not the same? What do you get for:-

sudo touch /run/zzz
sudo ls -l /var/run/zzz

@tiapfy
Copy link
Author

tiapfy commented Oct 9, 2023

"No such file or directory"

@matt335672
Copy link
Member

Right, so those directories aren't the same and it looks like systemd is assuming they are.

We can make them the same, but it will be disruptive. If they've been separated for a good reason (I really can't think of one) this could cause issues that might require console access to fix.

Can you get to the console of the VPS, or do you just has ssh access? My worry is that if the machine won't boot properly after this change you could be locked out of it.

@tiapfy
Copy link
Author

tiapfy commented Oct 9, 2023

I can only access with SSH, sadly. I would have to wait for the weekend to test it without causing problems. What is the procedure?

@matt335672
Copy link
Member

What do you get for the command mount | grep /run ?

Depending on the above, I'd think the following would do it, logged in over ssh:-

  1. sudo mv /var/run /var/oldrun
  2. sudo ln -s /run /var/run
  3. sudo reboot

None of those steps should report an error. If they do, something else is going on.

Does that make sense?

@tiapfy
Copy link
Author

tiapfy commented Oct 11, 2023

Here's the output:

tmpfs on /run type tmpfs (rw,nosuid,nodev,size=1677724k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
none on /run/shm type tmpfs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1677720k,mode=                                                                                                                                                             700,uid=1000,gid=1000)

@matt335672
Copy link
Member

Right - nothing is mounted on /var/run. So it looks like a simple case of the symlink being deleted.

The steps I gave you above should be sufficient to restore a standard layout.

@doonze
Copy link

doonze commented Oct 12, 2023

So, this problem gets deeper. I'm having the same issue, and I thought you were onto something here. I read that other issue you closed where the guy said a syslink fixed it. But since the website was a dead link, we couldn't see what he did.

I did as you asked above. following your instructions. I created a syslink from /run to /var/run. It worked fine, the link was created. I've verified. I was still getting the error that xrpd-sesman cannot find the pid in /var/run/xrdp/xrdp-seshman.pid. I even went as far as doing a sudo mkdir xrpd, as there wasn't one. I know most processes create their own path, but I just wanted to see what happened. What happens is that after xrdp-sesman fails, it deletes the directory. Expected. But it DOES show it's following the path! But it's still not working.

I started getting this issue after updating my VM from Mint 20.* to Mint 21.2 (which uses ubuntu as its base). Net net, I'm getting bit by this new Ubuntu bug.

EDIT:
Well, it seems I may have fixed it. After much playing, I simply tried:
sudo apt reinstall xrdp

and well.... it worked. I don't know if adding the /var/run syslink helped or not. I'll be honest, since I was having this EXACT same problem, I didn't think to check if I already HAD a /var/run/. I did issue the mvdir command you had in your instructions above, and I now have a linked /var/oldrun. So I kinda suspect I did already have it. I DIDN'T try a reinstall, or a remove/install, before because I had seen other threads where that hadn't worked. But... it worked for me. And is the easiest thing to try. I have rebooted several times, and it's still working. Soo.... I'll call it fixed for now. No idea how a reinstall worked. But weirder things have happened. Linux isn't just an OS, it's an adventure!

@matt335672
Copy link
Member

Triaging these things can be pretty difficult, as fixing something ASAP puts huge pressures on trying to work through problems slowly and methodically.

If your /var/oldrun is a link now, it would have been before the procedure was followed.

In any case, thanks for raising this. I don't think we've really got to the bottom of the issue (or the ones mentioned above), but I'm glad it's working at the moment. I'll leave this open for a bit just in case more information surfaces.

@tiapfy
Copy link
Author

tiapfy commented Oct 12, 2023

Ok I tried the steps and rebooted and now it seems to work. Thank you for the help you provided even though it wasn't a problem directly related to xrdp.

@kayrules
Copy link

I can confirm the steps below fixed this issue on Linux Mint 21.2 and xrdp 0.9.17

  • Edit /lib/systemd/system/xrdp-sesman.service. Replace PIDFile=/run/xrdp/xrdp-sesman.pid with PIDFile=/var/run/xrdp/xrdp-sesman.pid
  • sudo systemctl daemon-reload
  • sudo mv /var/run /var/oldrun
  • sudo ln -s /run /var/run
  • sudo reboot

@tobias47n9e
Copy link

I think I encountered this issue after upgrading from Ubuntu 23.04 to 23.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants