Score:0

Diagnosing why xrdp fails to start the service after boot

mk flag

I am having some trouble with diagnosing why xrdp fails to start the service after boot.

× xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout)
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
        CPU: 8ms

[INFO ] xrdp_listen_pp done
systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: Operation not perm>
xrdp[1440]: [INFO ] starting xrdp with pid 1440
xrdp[1440]: [INFO ] address [0.0.0.0] port [3389] mode 1
xrdp[1440]: [INFO ] listening to port 3389 on 0.0.0.0
xrdp[1440]: [INFO ] xrdp_listen_pp done
systemd[1]: xrdp.service: start operation timed out. Terminating.
xrdp[1440]: [INFO ] Received termination signal, stopping the server accept new connections thread
systemd[1]: xrdp.service: Failed with result 'timeout'.
systemd[1]: Stopped xrdp daemon.

but if started manually, it works fine.

● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-04-14 11:49:58 IDT; 9s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 2852 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
    Process: 2860 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 2861 (xrdp)
      Tasks: 1 (limit: 38359)
     Memory: 860.0K
        CPU: 5ms
     CGroup: /system.slice/xrdp.service
             └─2861 /usr/sbin/xrdp

systemd[1]: Starting xrdp daemon...
xrdp[2860]: [INFO ] address [0.0.0.0] port [3389] mode 1
xrdp[2860]: [INFO ] listening to port 3389 on 0.0.0.0
xrdp[2860]: [INFO ] xrdp_listen_pp done
systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: Operation not perm>
systemd[1]: Started xrdp daemon.
xrdp[2861]: [INFO ] starting xrdp with pid 2861
xrdp[2861]: [INFO ] address [0.0.0.0] port [3389] mode 1
xrdp[2861]: [INFO ] listening to port 3389 on 0.0.0.0
xrdp[2861]: [INFO ] xrdp_listen_pp done

How would you suggest diagnosing this issue? I am clueless and the top results don't seem to work or make sense to me why they would work.

David avatar
cn flag
What version of Ubuntu are you using?
Yorai Levi avatar
mk flag
@David 22.04 LTS
Score:1
id flag

having the same problem. thought that error about "Can't open PID file" might be the issue but during the 90 seconds it takes the xrdp service to fail to start the /run/xrdp directory exists with pid files in it for both xrdp and xrdp-sesman.

I'm thinking something else is going wrong.

Yorai Levi avatar
mk flag
+1 I am still stuck on this because lack of time. I would love to hear if you have any followups
Score:1
mk flag

based on: https://www.suse.com/support/kb/doc/?id=000019917 this solved the issue:

systemctl edit xrdp.service

and then type the following above the ### Lines below this comment will be discarded line (we're basically adding 'multi-user.target' to the original definition):

[Unit]
After=multi-user.target network.target xrdp-sesman.service

Cause
By default xrdp is set to start after the network. In some cases xrdp appears to start a bit too early leading to a timeout. This work around creates an override for the default xrdp service so that it starts after multi-user.target delaying its start in the boot process a little bit. This change is persistent between updates.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.