<refsynopsisdiv>
<para><filename>systemd-journal-gatewayd.service</filename></para>
<para><filename>systemd-journal-gatewayd.socket</filename></para>
- <cmdsynopsis><command>/usr/lib/systemd/systemd-journal-gatewayd</command>
+ <cmdsynopsis>
+ <command>/usr/lib/systemd/systemd-journal-gatewayd</command>
+ <arg choice="opt" rep="repeat">OPTIONS</arg>
</cmdsynopsis>
</refsynopsisdiv>
<para><command>systemd-journal-gatewayd</command> serves journal
events over the network. Clients must connect using
- HTTP. The server listens on port 19531 by default.</para>
+ HTTP. The server listens on port 19531 by default.
+ If <option>--cert=</option> is specified, the server expects
+ HTTPS connections.</para>
<para>The program is started by
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
to have it started on boot.</para>
</refsect1>
+ <refsect1>
+ <title>Options</title>
+
+ <para>The following options are understood:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><option>--help</option></term>
+ <term><option>-h</option></term>
+
+ <listitem><para>Prints a short help
+ text and exits.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--version</option></term>
+
+ <listitem><para>Prints a short version
+ string and exits.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--cert=</option></term>
+
+ <listitem><para>Specify the path to a file containing a server
+ certificate in PEM format. This option switches
+ <command>systemd-journal-gatewayd</command> into HTTPS mode
+ and must be used together with
+ <option>--key=</option>.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--key=</option></term>
+
+ <listitem><para>Specify the path to a file containing a server
+ key in PEM format corresponding to the certificate specified
+ with <option>--cert=</option>.</para></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
<refsect1>
<title>Supported URLs</title>
return respond_error(connection, MHD_HTTP_NOT_FOUND, "Not found.\n");
}
+static int help(void) {
+
+ printf("%s [OPTIONS...] ...\n\n"
+ "HTTP server for journal events.\n\n"
+ " -h --help Show this help\n"
+ " --version Show package version\n"
+ " --cert=CERT.PEM Specify server certificate in PEM format\n"
+ " --key=KEY.PEM Specify server key in PEM format\n",
+ program_invocation_short_name);
+
+ return 0;
+}
+
static char *key_pem = NULL;
static char *cert_pem = NULL;
int r, c;
static const struct option options[] = {
+ { "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, ARG_VERSION },
{ "key", required_argument, NULL, ARG_KEY },
{ "cert", required_argument, NULL, ARG_CERT },
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "", options, NULL)) >= 0)
+ while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0)
switch(c) {
case ARG_VERSION:
puts(PACKAGE_STRING);
puts(SYSTEMD_FEATURES);
return 0;
+ case 'h':
+ return help();
+
case ARG_KEY:
if (key_pem) {
log_error("Key file specified twice");