Search code examples
ubuntuubuntu-18.04pidrdpxrdp

xrdp can´t open PID file /run/xrdp/xrdp.pid (yet?) after start: Operation not permitted


Im pretty new to working with ubuntu, hopeing for some help :).
Installed xrdp with xcfe4 on ubuntu18.04. Ended up with the following;
cant connect to the server,
already tried changing permissions to the file

xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-03-02 20:03:42 CET; 16min ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 1269 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
    Process: 1286 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 1289 (xrdp)
      Tasks: 1 (limit: 618978)
     Memory: 2.9M
     CGroup: /system.slice/xrdp.service
             └─1289 /usr/sbin/xrdp

xrdp[1286]: (1286)(140316376414016)[INFO ] address [0.0.0.0] port [3389] mode 1
xrdp[1286]: (1286)(140316376414016)[INFO ] listening to port 3389 on 0.0.0.0
xrdp[1286]: (1286)(140316376414016)[INFO ] xrdp_listen_pp done
xrdp[1286]: (1286)(140316376414016)[DEBUG] Closed socket 7 (AF_INET6 :: port 3389)
---> systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: Operation not permitted <---
systemd[1]: Started xrdp daemon.
xrdp[1289]: (1289)(140316376414016)[INFO ] starting xrdp with pid 1289
xrdp[1289]: (1289)(140316376414016)[INFO ] address [0.0.0.0] port [3389] mode 1
xrdp[1289]: (1289)(140316376414016)[INFO ] listening to port 3389 on 0.0.0.0
xrdp[1289]: (1289)(140316376414016)[INFO ] xrdp_listen_pp done

Solution

  • I did research and found that the xrdp.pid file disappears if you stop the service with:

    sudo systemctl stop xrdp
    

    And after starting the server again, it appears with the correct pid in the file. You can test with:

    sudo systemctl start xrdp
    sudo ls -lat /run/xrdp/xrdp.pid
    sudo more /run/xrdp/xrdp.pid
    ps -ef | grep xrdp
    

    So, it seems that this message is just a test to know if there is already another instance running, but in fact, causes no harm. Sorry if it does not solve your problem of establishing a connection, but at least, I try to answer your question and point you in other direction because the messages doesn't relate to the connectivity problem.