You are not logged in.

#1 2023-02-05 10:15:52

prayner96
Member
Registered: 2022-03-06
Posts: 68

[SOLVED] xrdp daemon failed to start

Installed xrdp AUR package.

Attempted to start the xrdp.service

$ sudo systemctl start xrdp.service
Job for xrdp.service failed because the control process exited with error code.
See "systemctl status xrdp.service" and "journalctl -xeu xrdp.service" for details.

Investigated

$ systemctl status xrdp.service
× xrdp.service - xrdp daemon
     Loaded: loaded (/usr/lib/systemd/system/xrdp.service; disabled; preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-02-05 11:05:00 CET; 3min 11s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 738 ExecStart=/usr/bin/xrdp (code=exited, status=1/FAILURE)
        CPU: 10ms

Feb 05 11:05:00 user_id systemd[1]: Starting xrdp daemon...
Feb 05 11:05:00 user_id xrdp[738]: [CORE ] It looks like xrdp is already running.
Feb 05 11:05:00 user_id xrdp[738]: [CORE ] If not, delete /var/run/xrdp.pid and try again.
Feb 05 11:05:00 user_id systemd[1]: xrdp.service: Control process exited, code=exited, status=1/FAILURE
Feb 05 11:05:00 user_id  systemd[1]: xrdp.service: Failed with result 'exit-code'.
Feb 05 11:05:00 user_id systemd[1]: Failed to start xrdp daemon.

So xrdp is already running, but nothing happened when I installed it? Did something go wrong with the installation?

Last edited by prayner96 (2023-02-08 10:12:39)

Offline

#2 2023-02-05 10:51:25

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] xrdp daemon failed to start

prayner96 wrote:

Installed xrdp AUR package

How exactly did you do that? I've just tried using makepkg and it all works as expected so I'm guessing you're using some crappy AUR "helper" that's messed things up for you.

Does the service start if you follow the advice given in the journal excerpt?


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#3 2023-02-05 13:24:42

seth
Member
Registered: 2012-09-03
Posts: 56,487

Re: [SOLVED] xrdp daemon failed to start

If it only checks for that lock file, probably. But then you might have two instances and the old one operates on the wrong lock.

stat /var/run/xrdp.pid 
cat /var/run/xrdp.pid
ps aux | grep xrdp
find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Online

#4 2023-02-05 17:36:07

prayner96
Member
Registered: 2022-03-06
Posts: 68

Re: [SOLVED] xrdp daemon failed to start

Correct @Head_on_a_Stick, I am using Paru. Figured it was better for keeping AUR packages updated simultaneously. You don't approve?

@seth:

$ stat /var/run/xrdp.pid 
stat: cannot statx '/var/run/xrdp.pid': No such file or directory
$ cat /var/run/xrdp.pid
cat: /var/run/xrdp.pid: No such file or directory
$ ps aux | grep xrdp
root         726  0.0  0.0  20440  1172 ?        S    11:04   0:00 xrdp
user        2336  0.0  0.0   6568  2480 pts/0    S+   18:26   0:00 grep xrdp
$ find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
dhcpcd.service                           | multi-user.target.wants
display-manager.service                  | system
getty@tty1.service                       | getty.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
wpa_supplicant@EE-Hub-hxR9.service       | multi-user.target.wants
wpa_supplicant@interface.service         | multi-user.target.wants
wpa_supplicant@wlp0s20f3.service         | multi-user.target.wants

Does the service start if you follow the advice given in the journal excerpt?

There is no /var/run/xrdp.pid file to delete.

I guess I installed it wrong. Perhaps I need to reinstall.

Offline

#5 2023-02-05 17:40:46

seth
Member
Registered: 2012-09-03
Posts: 56,487

Re: [SOLVED] xrdp daemon failed to start

root         726  0.0  0.0  20440  1172 ?        S    11:04   0:00 xrdp

There's an instance running but apparently no /var/run/xrdp.pid ?
What started it? Why is there no lockfile?

Online

#6 2023-02-05 19:18:27

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] xrdp daemon failed to start

The PID file should be found at /run/xrdp.pid thanks to the arch-config.diff applied by the package:

diff -up src/xrdp-0.9.16/instfiles/xrdp.service.in.orig src/xrdp-0.9.16/instfiles/xrdp.service.in
--- src/xrdp-0.9.16/instfiles/xrdp.service.in.orig   2020-06-26 05:13:58.000000000 -0600
+++ src/xrdp-0.9.16/instfiles/xrdp.service.in   2021-05-12 17:06:31.680000000 -0600
@@ -6,11 +6,9 @@ After=network.target xrdp-sesman.service
 
 [Service]
 Type=forking
-PIDFile=@localstatedir@/run/xrdp.pid
-EnvironmentFile=-@sysconfdir@/sysconfig/xrdp
-EnvironmentFile=-@sysconfdir@/default/xrdp
-ExecStart=@sbindir@/xrdp $XRDP_OPTIONS
-ExecStop=@sbindir@/xrdp $XRDP_OPTIONS --kill
+PIDFile=/run/xrdp.pid
+ExecStart=@sbindir@/xrdp
+ExecStop=@sbindir@/xrdp --kill
 
 [Install]
 WantedBy=multi-user.target

No idea why though hmm

From my box:

$ pacman -Q xrdp
xrdp 0.9.21.1-1
$ pgrep -a xrd 
1$ doas systemctl start xrdp
$ pgrep -a xrd              
38397 /usr/bin/xrdp-sesman
38399 /usr/bin/xrdp
$ stat /run/xrdp.pid
  File: /run/xrdp.pid
  Size: 5         	Blocks: 8          IO Block: 4096   regular file
Device: 0,21	Inode: 1257        Links: 1
Access: (0600/-rw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-02-05 19:14:13.484762256 +0000
Modify: 2023-02-05 19:14:13.484762256 +0000
Change: 2023-02-05 19:14:13.484762256 +0000
 Birth: 2023-02-05 19:14:13.484762256 +0000
$ doas cat /run/xrdp.pid 
38399$
prayner96 wrote:

I am using Paru. Figured it was better for keeping AUR packages updated simultaneously. You don't approve?

I don't approve of most AUR packages so naturally I have a low opinion of any "helpers".

But that's not important here. Have you tried installing the package manually? Does it work then?


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#7 2023-02-05 19:27:26

seth
Member
Registered: 2012-09-03
Posts: 56,487

Re: [SOLVED] xrdp daemon failed to start

realpath /var/run

Online

#8 2023-02-05 19:28:18

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] xrdp daemon failed to start

^ D'oh! Thanks seth :-)


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#9 2023-02-07 17:05:30

prayner96
Member
Registered: 2022-03-06
Posts: 68

Re: [SOLVED] xrdp daemon failed to start

There's an instance running but apparently no /var/run/xrdp.pid ?
What started it? Why is there no lockfile?

I don't know.

I tried killing the living sessions of xrdp and then starting again, but it was no use. Then I tried to enable the service, but it did nothing either. Although now there is an actual output for the following code:

$ stat /var/run/xrdp.pid 
  File: /var/run/xrdp.pid
  Size: 5         	Blocks: 8          IO Block: 4096   regular file
Device: 0,21	Inode: 1569        Links: 1
Access: (0600/-rw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-02-07 17:30:08.813187130 +0100
Modify: 2023-02-07 17:30:08.813187130 +0100
Change: 2023-02-07 17:30:08.813187130 +0100
 Birth: 2023-02-07 17:30:08.813187130 +0100

$ sudo cat /var/run/xrdp.pid
46789

$ sudo ps aux | grep xrdp
root       46787  0.0  0.0  12976   872 ?        S    17:30   0:00 /usr/bin/xrdp-sesman
root       46789  0.0  0.0  20444  1168 ?        S    17:30   0:00 /usr/bin/xrdp
baz_mor+   48703  0.0  0.0   6568  2508 pts/5    S+   17:39   0:00 grep xrdp

$ find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
dhcpcd.service                           | multi-user.target.wants
display-manager.service                  | system
getty@tty1.service                       | getty.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
wpa_supplicant@EE-Hub-hxR9.service       | multi-user.target.wants
wpa_supplicant@interface.service         | multi-user.target.wants
wpa_supplicant@wlp0s20f3.service         | multi-user.target.wants
xrdp.service                             | multi-user.target.wants

Still, nothing worked. So I killed the processes again and checked xrdp status:

$ systemctl status xrdp
× xrdp.service - xrdp daemon
     Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; preset: d>
     Active: failed (Result: signal) since Tue 2023-02-07 17:46:37 CET; 2min >
   Duration: 16min 28.717s
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 46789 (code=killed, signal=KILL)
        CPU: 13ms

Feb 07 17:30:07 user xrdp[46788]: [INFO ] listening to port 3389 on 0.0.0>
Feb 07 17:30:07 user xrdp[46788]: [INFO ] xrdp_listen_pp done
Feb 07 17:30:07 user systemd[1]: xrdp.service: Can't open PID file /run/x>
Feb 07 17:30:08 user systemd[1]: Started xrdp daemon.
Feb 07 17:30:09 user xrdp[46789]: [INFO ] starting xrdp with pid 46789
Feb 07 17:30:09 user xrdp[46789]: [INFO ] address [0.0.0.0] port [3389] m>
Feb 07 17:30:09 user xrdp[46789]: [INFO ] listening to port 3389 on 0.0.0>
Feb 07 17:30:09 user xrdp[46789]: [INFO ] xrdp_listen_pp done
Feb 07 17:46:37 user systemd[1]: xrdp.service: Main process exited, code=>
Feb 07 17:46:37 user systemd[1]: xrdp.service: Failed with result 'signal>

Note: I am using Qtile without a DE and I have not installed `xorgxrdp`.

Offline

#10 2023-02-07 17:27:06

seth
Member
Registered: 2012-09-03
Posts: 56,487

Re: [SOLVED] xrdp daemon failed to start

eb 07 17:30:07 user xrdp[46788]: [INFO ] listening to port 3389 on 0.0.0>
Feb 07 17:30:07 user xrdp[46788]: [INFO ] xrdp_listen_pp done
Feb 07 17:30:07 user systemd[1]: xrdp.service: Can't open PID file /run/x>
Feb 07 17:46:37 user systemd[1]: xrdp.service: Main process exited, code=>
Feb 07 17:46:37 user systemd[1]: xrdp.service: Failed with result 'signal>

Don't copy and paste out of the pager, redirect the ouptut into a file.

Also don't show the status after you actively killed the service process, of course it will just show that the process was killed then.

Online

#11 2023-02-07 20:13:24

prayner96
Member
Registered: 2022-03-06
Posts: 68

Re: [SOLVED] xrdp daemon failed to start

Okay I think I just did

sudo systemctl start xrdp

or some variatoin of xrdp, xrdp-service, xrdp.service.

 xrdp.service - xrdp daemon
     Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; preset: disabled)
     Active: active (running) since Tue 2023-02-07 20:10:50 CET; 48min ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 59427 (xrdp)
      Tasks: 1 (limit: 18914)
     Memory: 1.3M
        CPU: 13ms
     CGroup: /system.slice/xrdp.service
             └─59427 /usr/bin/xrdp

Feb 07 20:10:49 user systemd[1]: Starting xrdp daemon...
Feb 07 20:10:49 user xrdp[59426]: [INFO ] address [0.0.0.0] port [3389] mode 1
Feb 07 20:10:49 user xrdp[59426]: [INFO ] listening to port 3389 on 0.0.0.0
Feb 07 20:10:49 user xrdp[59426]: [INFO ] xrdp_listen_pp done
Feb 07 20:10:49 user systemd[1]: xrdp.service: Can't open PID file /run/xrdp.pid (yet?) after start: Operation not permitted
Feb 07 20:10:50 user systemd[1]: Started xrdp daemon.
Feb 07 20:10:51 user xrdp[59427]: [INFO ] starting xrdp with pid 59427
Feb 07 20:10:51 user xrdp[59427]: [INFO ] address [0.0.0.0] port [3389] mode 1
Feb 07 20:10:51 user xrdp[59427]: [INFO ] listening to port 3389 on 0.0.0.0
Feb 07 20:10:51 user xrdp[59427]: [INFO ] xrdp_listen_pp done

It's active now, so problem solved! Still, when I type `xrdp`, nothing happens. Is that normal at this stage?

Last edited by prayner96 (2023-02-07 20:14:05)

Offline

#12 2023-02-07 23:20:13

seth
Member
Registered: 2012-09-03
Posts: 56,487

Re: [SOLVED] xrdp daemon failed to start

https://wiki.archlinux.org/title/Xrdp#Usage

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

Board footer

Powered by FluxBB