Merge pull request #629 from proski/cmdline

Improve command line documentation for xrdp and xrdp-sesman
master
metalefty 7 years ago committed by GitHub
commit 27b58884fd

@ -15,13 +15,22 @@ It can also be used as a VNC\->RDP bridge.
.SH "OPTIONS"
.TP
\fB\-n\fR, \fB\-\-nodaemon\fR
Starts \fBxrdp\fR in foreground instead of starting it as a daemon.
Start \fBxrdp\fR in foreground instead of starting it as a daemon.
.TP
\fB\-k\fR, \fB\-\-kill\fR
Kills running \fBxrdp\fR daemon.
Kill running \fBxrdp\fR daemon.
.TP
\fB\-h\fR, \fB\-\-help\fR
Output help information and exit.
.TP
\fB\-p\fR, \fB\-\-port\fR
Specify TCP port to listen to. This overrides \fIport\fR setting in
\fIxrdp.ini\fR file.
.TP
\fB\-f\fR, \fB\-\-fork\fR
Fork a new process on a new connection. If not enabled, use a new thread
for every connection. This overrides \fIfork\fR setting in
\fIxrdp.ini\fR file.
.SH "FILES"
@bindir@/xrdp

@ -130,6 +130,19 @@ sesman_main_loop(void)
g_tcp_close(g_sck);
}
/******************************************************************************/
void
print_usage(int retcode)
{
g_printf("xrdp-sesman - xrdp session manager\n\n");
g_printf("Usage: xrdp-sesman [options]\n");
g_printf(" -n, --nodaemon run as foreground process\n");
g_printf(" -k, --kill kill running xrdp-sesman\n");
g_printf(" -h, --help show this help\n");
g_deinit();
g_exit(retcode);
}
/******************************************************************************/
int DEFAULT_CC
main(int argc, char **argv)
@ -166,16 +179,7 @@ main(int argc, char **argv)
(0 == g_strcasecmp(argv[1], "-help")) ||
(0 == g_strcasecmp(argv[1], "-h"))))
{
/* help screen */
g_printf("sesman - xrdp session manager\n\n");
g_printf("usage: sesman [command]\n\n");
g_printf("command can be one of the following:\n");
g_printf("-n, -ns, --nodaemon starts sesman in foreground\n");
g_printf("-k, --kill kills running sesman\n");
g_printf("-h, --help shows this help\n");
g_printf("if no command is specified, sesman is started in background");
g_deinit();
g_exit(0);
print_usage(0);
}
else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--kill")) ||
(0 == g_strcasecmp(argv[1], "-kill")) ||
@ -229,16 +233,13 @@ main(int argc, char **argv)
else
{
/* there's something strange on the command line */
g_printf("sesman - xrdp session manager\n\n");
g_printf("error: invalid command line\n");
g_printf("usage: sesman [ --nodaemon | --kill | --help ]\n");
g_deinit();
g_exit(1);
g_printf("Error: invalid command line arguments\n\n");
print_usage(1);
}
if (g_file_exist(pid_file))
{
g_printf("sesman is already running.\n");
g_printf("xrdp-sesman is already running.\n");
g_printf("if it's not running, try removing ");
g_printf("%s", pid_file);
g_printf("\n");

@ -246,6 +246,7 @@ xrdp_process_params(int argc, char **argv,
}
else if ((g_strncasecmp(option, "-nodaemon", 255) == 0) ||
(g_strncasecmp(option, "--nodaemon", 255) == 0) ||
(g_strncasecmp(option, "-n", 255) == 0) ||
(g_strncasecmp(option, "-nd", 255) == 0) ||
(g_strncasecmp(option, "--nd", 255) == 0) ||
(g_strncasecmp(option, "-ns", 255) == 0) ||
@ -401,11 +402,11 @@ main(int argc, char **argv)
g_writeln("See http://www.xrdp.org for more information.");
g_writeln("%s", "");
g_writeln("Usage: xrdp [options]");
g_writeln(" --help: show help");
g_writeln(" --nodaemon: don't fork into background");
g_writeln(" --kill: shut down xrdp");
g_writeln(" --port: tcp listen port");
g_writeln(" --fork: fork on new connection");
g_writeln(" -h, --help show help");
g_writeln(" -n, --nodaemon don't fork into background");
g_writeln(" -k, --kill shut down xrdp");
g_writeln(" -p, --port tcp listen port");
g_writeln(" -f, --fork fork on new connection");
g_writeln("%s", "");
g_deinit();
g_exit(0);

Loading…
Cancel
Save