]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-journal-upload.service.xml
Merge pull request #9116 from poettering/tmpfiles-tmp-var-tmp
[thirdparty/systemd.git] / man / systemd-journal-upload.service.xml
CommitLineData
3802a3d3 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
330427e2 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3db93b3f
YW
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
330427e2
ZJS
7
8<!--
572eb058
ZJS
9 SPDX-License-Identifier: LGPL-2.1+
10
5de0ccff 11 This file is part of systemd.
330427e2 12
5de0ccff 13 Copyright 2014 Zbigniew Jędrzejewski-Szmek
330427e2
ZJS
14-->
15
16<refentry id="systemd-journal-upload" conditional='HAVE_MICROHTTPD'
17 xmlns:xi="http://www.w3.org/2001/XInclude">
18
19 <refentryinfo>
1f416853 20 <title>systemd-journal-upload.service</title>
330427e2
ZJS
21 <productname>systemd</productname>
22
23 <authorgroup>
24 <author>
25 <contrib>Developer</contrib>
26 <firstname>Zbigniew</firstname>
27 <surname>Jędrzejewski-Szmek</surname>
28 <email>zbyszek@in.waw.pl</email>
29 </author>
30 </authorgroup>
31 </refentryinfo>
32
33 <refmeta>
1f416853 34 <refentrytitle>systemd-journal-upload.service</refentrytitle>
330427e2
ZJS
35 <manvolnum>8</manvolnum>
36 </refmeta>
37
38 <refnamediv>
1f416853 39 <refname>systemd-journal-upload.service</refname>
330427e2
ZJS
40 <refname>systemd-journal-upload</refname>
41 <refpurpose>Send journal messages over the network</refpurpose>
42 </refnamediv>
43
44 <refsynopsisdiv>
1f416853 45 <para><filename>systemd-journal-upload.service</filename></para>
330427e2 46 <cmdsynopsis>
1f416853 47 <command>/usr/lib/systemd/systemd-journal-upload</command>
330427e2
ZJS
48 <arg choice="opt" rep="repeat">OPTIONS</arg>
49 <arg choice="opt" rep="norepeat">-u/--url=<replaceable>URL</replaceable></arg>
50 <arg choice="opt" rep="repeat">SOURCES</arg>
51 </cmdsynopsis>
52 </refsynopsisdiv>
53
54 <refsect1>
55 <title>Description</title>
56
c643653e 57 <para><command>systemd-journal-upload</command> will upload journal entries to the URL specified
492cb509 58 with <option>--url=</option>. This program reads journal entries from one or more journal files,
c643653e
ZJS
59 similarly to
60 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
61 Unless limited by one of the options specified below, all journal entries accessible to the user
62 the program is running as will be uploaded, and then the program will wait and send new entries
63 as they become available.</para>
0b063391
ZJS
64
65 <para><filename>systemd-journal-upload.service</filename> is a system service that uses
66 <command>systemd-journal-upload</command> to upload journal entries to a server. It uses the
67 configuration in
68 <citerefentry><refentrytitle>journal-upload.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
69 At least the <varname>URL=</varname> option must be specified.</para>
330427e2
ZJS
70 </refsect1>
71
72 <refsect1>
73 <title>Options</title>
74
75 <variablelist>
76 <varlistentry>
77 <term><option>-u</option></term>
767f565f
YW
78 <term><option>--url=<optional>https://</optional><replaceable>URL</replaceable>[:<replaceable>PORT</replaceable>]</option></term>
79 <term><option>--url=<optional>http://</optional><replaceable>URL</replaceable>[:<replaceable>PORT</replaceable>]</option></term>
330427e2
ZJS
80
81 <listitem><para>Upload to the specified
82 address. <replaceable>URL</replaceable> may specify either
83 just the hostname or both the protocol and
84 hostname. <constant>https</constant> is the default.
767f565f
YW
85 The port number may be specified after a colon (<literal>:</literal>),
86 otherwise <constant>19532</constant> will be used by default.
330427e2
ZJS
87 </para></listitem>
88 </varlistentry>
89
90 <varlistentry>
91 <term><option>--system</option></term>
92 <term><option>--user</option></term>
93
94 <listitem><para>Limit uploaded entries to entries from system
95 services and the kernel, or to entries from services of
96 current user. This has the same meaning as
97 <option>--system</option> and <option>--user</option> options
98 for
99 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. If
100 neither is specified, all accessible entries are uploaded.
101 </para></listitem>
102 </varlistentry>
103
104 <varlistentry>
105 <term><option>-m</option></term>
106 <term><option>--merge</option></term>
107
108 <listitem><para>Upload entries interleaved from all available
109 journals, including other machines. This has the same meaning
110 as <option>--merge</option> option for
111 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para></listitem>
112 </varlistentry>
113
114 <varlistentry>
115 <term><option>-D</option></term>
116 <term><option>--directory=<replaceable>DIR</replaceable></option></term>
117
118 <listitem><para>Takes a directory path as argument. Upload
119 entries from the specified journal directory
120 <replaceable>DIR</replaceable> instead of the default runtime
121 and system journal paths. This has the same meaning as
492cb509 122 <option>--directory=</option> option for
330427e2
ZJS
123 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
124 </para></listitem>
125 </varlistentry>
126
127 <varlistentry>
128 <term><option>--file=<replaceable>GLOB</replaceable></option></term>
129
130 <listitem><para>Takes a file glob as an argument. Upload
131 entries from the specified journal files matching
132 <replaceable>GLOB</replaceable> instead of the default runtime
133 and system journal paths. May be specified multiple times, in
134 which case files will be suitably interleaved. This has the same meaning as
492cb509 135 <option>--file=</option> option for
330427e2
ZJS
136 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
137 </para></listitem>
138 </varlistentry>
139
140 <varlistentry>
141 <term><option>--cursor=</option></term>
142
143 <listitem><para>Upload entries from the location in the
144 journal specified by the passed cursor. This has the same
492cb509 145 meaning as <option>--cursor=</option> option for
330427e2
ZJS
146 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para></listitem>
147 </varlistentry>
148
149 <varlistentry>
150 <term><option>--after-cursor=</option></term>
151
152 <listitem><para>Upload entries from the location in the
153 journal <emphasis>after</emphasis> the location specified by
154 the this cursor. This has the same meaning as
492cb509 155 <option>--after-cursor=</option> option for
330427e2
ZJS
156 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
157 </para></listitem>
158 </varlistentry>
159
330427e2
ZJS
160 <varlistentry>
161 <term><option>--save-state</option><optional>=<replaceable>PATH</replaceable></optional></term>
162
163 <listitem><para>Upload entries from the location in the
164 journal <emphasis>after</emphasis> the location specified by
165 the cursor saved in file at <replaceable>PATH</replaceable>
166 (<filename>/var/lib/systemd/journal-upload/state</filename> by default).
167 After an entry is successfully uploaded, update this file
168 with the cursor of that entry.
169 </para></listitem>
170 </varlistentry>
171
3db93b3f
YW
172 <varlistentry>
173 <term><option>--follow</option><optional>=<replaceable>BOOL</replaceable></optional></term>
174
175 <listitem><para>
176 If set to yes, then <command>systemd-journal-upload</command> waits for input.
177 </para></listitem>
178 </varlistentry>
179
180 <varlistentry>
181 <term><option>--key=</option></term>
182
183 <listitem><para>
184 Takes a path to a SSL key file in PEM format.
185 Defaults to <filename>&CERTIFICATE_ROOT;/private/journal-upload.pem</filename>.
186 </para></listitem>
187 </varlistentry>
188
189 <varlistentry>
190 <term><option>--cert=</option></term>
191
192 <listitem><para>
193 Takes a path to a SSL certificate file in PEM format.
194 Defaults to <filename>&CERTIFICATE_ROOT;/certs/journal-upload.pem</filename>.
195 </para></listitem>
196 </varlistentry>
197
198 <varlistentry>
199 <term><option>--trust=</option></term>
200
201 <listitem><para>
202 Takes a path to a SSL CA certificate file in PEM format,
203 or <option>all</option>. If <option>all</option> is set,
204 then certificate checking will be disabled.
205 Defaults to <filename>&CERTIFICATE_ROOT;/ca/trusted.pem</filename>.
206 </para></listitem>
207 </varlistentry>
208
330427e2
ZJS
209 <xi:include href="standard-options.xml" xpointer="help" />
210 <xi:include href="standard-options.xml" xpointer="version" />
211 </variablelist>
212 </refsect1>
213
214 <refsect1>
215 <title>Exit status</title>
216
217 <para>On success, 0 is returned; otherwise, a non-zero
218 failure code is returned.</para>
219 </refsect1>
220
99a1ab10
ZJS
221 <refsect1>
222 <title>Examples</title>
223 <example>
224 <title>Setting up certificates for authentication</title>
225
226 <para>Certificates signed by a trusted authority are used to
227 verify that the server to which messages are uploaded is
228 legitimate, and vice versa, that the client is trusted.</para>
229
230 <para>A suitable set of certificates can be generated with
b5340a29 231 <command>openssl</command>. Note, 2048 bits of key length
32f511ec 232 is minimally recommended to use for security reasons:</para>
99a1ab10
ZJS
233
234 <programlisting>openssl req -newkey rsa:2048 -days 3650 -x509 -nodes \
235 -out ca.pem -keyout ca.key -subj '/CN=Certificate authority/'
236
b938cb90 237cat &gt;ca.conf &lt;&lt;EOF
99a1ab10
ZJS
238[ ca ]
239default_ca = this
240
241[ this ]
242new_certs_dir = .
243certificate = ca.pem
244database = ./index
245private_key = ca.key
246serial = ./serial
247default_days = 3650
248default_md = default
249policy = policy_anything
250
251[ policy_anything ]
252countryName = optional
253stateOrProvinceName = optional
254localityName = optional
255organizationName = optional
256organizationalUnitName = optional
257commonName = supplied
258emailAddress = optional
259EOF
260
261touch index
b938cb90 262echo 0001 &gt;serial
99a1ab10
ZJS
263
264SERVER=server
265CLIENT=client
266
562b65ca 267openssl req -newkey rsa:2048 -nodes -out $SERVER.csr -keyout $SERVER.key -subj "/CN=$SERVER/"
99a1ab10
ZJS
268openssl ca -batch -config ca.conf -notext -in $SERVER.csr -out $SERVER.pem
269
562b65ca 270openssl req -newkey rsa:2048 -nodes -out $CLIENT.csr -keyout $CLIENT.key -subj "/CN=$CLIENT/"
99a1ab10
ZJS
271openssl ca -batch -config ca.conf -notext -in $CLIENT.csr -out $CLIENT.pem
272</programlisting>
273
274 <para>Generated files <filename>ca.pem</filename>,
275 <filename>server.pem</filename>, and
276 <filename>server.key</filename> should be installed on server,
277 and <filename>ca.pem</filename>,
278 <filename>client.pem</filename>, and
279 <filename>client.key</filename> on the client. The location of
280 those files can be specified using
281 <varname>TrustedCertificateFile=</varname>,
282 <varname>ServerCertificateFile=</varname>,
283 <varname>ServerKeyFile=</varname>, in
12b42c76 284 <filename>/etc/systemd/journal-remote.conf</filename> and
b938cb90 285 <filename>/etc/systemd/journal-upload.conf</filename>,
99a1ab10
ZJS
286 respectively. The default locations can be queried by using
287 <command>systemd-journal-remote --help</command> and
288 <command>systemd-journal-upload --help</command>.</para>
289 </example>
290 </refsect1>
291
330427e2
ZJS
292 <refsect1>
293 <title>See Also</title>
294 <para>
3eff246a 295 <citerefentry><refentrytitle>journal-upload.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1f416853 296 <citerefentry><refentrytitle>systemd-journal-remote.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
330427e2
ZJS
297 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
298 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
299 <citerefentry><refentrytitle>systemd-journal-gatewayd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
300 </para>
301 </refsect1>
302</refentry>