diff options
Diffstat (limited to 'xrdp/xrdp.c')
-rw-r--r-- | xrdp/xrdp.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 54613ac3..cdd611f5 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -550,7 +550,17 @@ main(int argc, char **argv) if (0 != pid) { - g_writeln("process %d started ok", pid); + /* if can't listen, exit with failure status */ + if (xrdp_listen_test() != 0) + { + log_message(LOG_LEVEL_ERROR, "Failed to start xrdp daemon, " + "possibly address already in use."); + g_deinit(); + /* must exit with failure status, + or systemd cannot detect xrdp daemon couldn't start properly */ + g_exit(1); + } + g_writeln("daemon process %d started ok", pid); /* exit, this is the main process */ g_deinit(); g_exit(0); |