X-Git-Url: https://git.tld-linux.org/?p=packages%2Fxrdp.git;a=blobdiff_plain;f=pidfile_early.patch;fp=pidfile_early.patch;h=080be50ed5928b8591148aaec199eddced20b1d4;hp=0000000000000000000000000000000000000000;hb=ff65cdbbd6ea4ce34c1381ea3c6d5da88db8ac35;hpb=64b912db915190fd50443dd67f200ccebd2a683d diff --git a/pidfile_early.patch b/pidfile_early.patch new file mode 100644 index 0000000..080be50 --- /dev/null +++ b/pidfile_early.patch @@ -0,0 +1,39 @@ +Ensure that the PID file is written before sleeping. + +Index: xrdp/xrdp/xrdp.c +=================================================================== +--- xrdp.orig/xrdp/xrdp.c 2012-09-29 13:03:27.666630538 +0200 ++++ xrdp/xrdp/xrdp.c 2012-09-29 13:03:32.874746622 +0200 +@@ -388,17 +388,6 @@ + g_deinit(); + g_exit(0); + } +- g_sleep(1000); +- g_file_close(0); +- g_file_close(1); +- g_file_close(2); +- g_file_open("/dev/null"); +- g_file_open("/dev/null"); +- g_file_open("/dev/null"); +- /* end of daemonizing code */ +- } +- if (!no_daemon) +- { + /* write the pid to file */ + pid = g_getpid(); + fd = g_file_open(pid_file); /* xrdp.pid */ +@@ -414,6 +403,14 @@ + g_file_write(fd, text, g_strlen(text)); + g_file_close(fd); + } ++ g_sleep(1000); ++ g_file_close(0); ++ g_file_close(1); ++ g_file_close(2); ++ g_file_open("/dev/null"); ++ g_file_open("/dev/null"); ++ g_file_open("/dev/null"); ++ /* end of daemonizing code */ + } + g_threadid = tc_get_threadid(); + g_listen = xrdp_listen_create();