The pidfile created by xrdp is created after a g_sleep(1000). It would be best for the pidfile to be created as early as possible after the daemon forks. The attached patch fixes xrdp.c to do so.
Please consider this patch in order to fix this bug.
Javier Fernandez-Sanguino Peña
Patch to fix pidfile generation
it had been commited