Compare commits

..

15 Commits

Author SHA1 Message Date
Yu Watanabe 3db7d5d2bf network: fix double free() 2019-11-28 19:50:45 +01:00
Yu Watanabe e681a2ee4d man: use literal tag at one more place 2019-11-28 19:50:12 +01:00
Lennart Poettering 0bca283127 man: document sd_event_source_set_floating()
Let's make sure we get back to 100% man page documentation coverage of
our sd-event APIs. We are bad enough at the others, let's get these ones
right at least.
2019-11-29 02:48:41 +09:00
Jan Tojnar 88eb051972 man: use mkswap@ instead of makeswap@
That is what is linked from systemd.swap(5) and also what the systemd.generator produces.
2019-11-28 15:46:21 +01:00
Lennart Poettering 806c6a5b97 journald: don't ask for the machine ID if we don't need it 2019-11-28 15:46:01 +01:00
Lennart Poettering 3aebd9d6dd journalctl: pager_close() calls fflush(stdout) anyway as first thing 2019-11-28 15:15:24 +01:00
Lennart Poettering c31469e2ee journald: remove unused field 2019-11-28 15:14:58 +01:00
Lennart Poettering 2275b74741 journalctl: return EOPNOTSUPP if pcre is not enabled 2019-11-28 15:02:36 +01:00
Lennart Poettering 870a2d85d0 man: don't claim journalctl would still use signals
It's using the varlink interface these days.
2019-11-28 14:33:31 +01:00
Lennart Poettering 5a5bd9f7e0 man: add reference to journald man page from systemd.journal-fields(7)
We had none so far. Which is weird.
2019-11-28 14:33:01 +01:00
Lennart Poettering d58b613bbb man: apparently we lowercased STDOUT/STDERR everywhere else in docs, do so here too 2019-11-28 14:25:38 +01:00
Lennart Poettering 6831520b02
Merge pull request #14179 from poettering/help-fixlets
--help fixlets
2019-11-28 14:22:30 +01:00
Lennart Poettering d18df32d82 man: drop reference to machined, add one for journald instead
We dropped documentation from sd_journal_open_container() long ago
(since the call is obsolete), hence drop the reference to machined. But
add one in for journald instead.
2019-11-28 14:22:12 +01:00
Lennart Poettering 6f63c5b8b1 notify: add color to --help
We do that for most tools now, do so here now, too.
2019-11-28 11:41:24 +01:00
Lennart Poettering 37a92352d6 nspawn: highlight description string in --help text
We do so in most tools now, do so here, too.
2019-11-28 11:41:24 +01:00
20 changed files with 166 additions and 51 deletions

View File

@ -437,6 +437,7 @@ manpages = [
'SD_EVENT_ONESHOT',
'sd_event_source_get_enabled'],
''],
['sd_event_source_set_floating', '3', ['sd_event_source_get_floating'], ''],
['sd_event_source_set_prepare', '3', [], ''],
['sd_event_source_set_priority',
'3',
@ -735,7 +736,7 @@ manpages = [
['systemd-growfs',
'systemd-growfs@.service',
'systemd-makefs',
'systemd-makeswap@.service'],
'systemd-mkswap@.service'],
''],
['systemd-modules-load.service', '8', ['systemd-modules-load'], 'HAVE_KMOD'],
['systemd-mount', '1', ['systemd-umount'], ''],

View File

@ -213,6 +213,7 @@
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -183,6 +183,7 @@
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -183,6 +183,7 @@
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -296,6 +296,7 @@
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_get_pending</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll_ctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>

View File

@ -187,6 +187,7 @@
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>
</para>

View File

@ -278,6 +278,7 @@
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>timerfd_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>

View File

@ -0,0 +1,118 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="sd_event_source_set_floating" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_event_source_set_floating</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>sd_event_source_set_floating</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_event_source_set_floating</refname>
<refname>sd_event_source_get_floating</refname>
<refpurpose>Set or retrieve 'floating' state of event sources</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_event_source_set_floating</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>int <parameter>floating</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_floating</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_event_source_set_floating()</function> takes a boolean and sets the 'floating' state
of the specified event source object. This is used to change the direction of reference counts for the
object and the event loop it is associated with. In non-floating mode, the event source object holds a
reference to the event loop object, but not vice versa. The creator of the event source object must hold
a reference to it as long as the source should exist. In floating mode, the event loop holds a reference
to the source object, and will decrease the reference count when being freed. This means that a reference
to the event loop should be held to prevent both from being destroyed.</para>
<para>Various calls that allocate event source objects (i.e.
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry> and
similar) will automatically set an event source object to 'floating' mode if the caller passed
<constant>NULL</constant> in the parameter used to return a reference to the event source object.
Nevertheless, it may be necessary to gain temporary access to the source object, for example to adjust
event source properties after allocation (e.g. its priority or description string). In those cases the
object may be created in non-floating mode, and the returned reference used to adjust the properties, and
the object marked as floating afterwards, and the reference in the caller dropped.</para>
<para><function>sd_event_source_get_floating()</function> may be used to query the current 'floating'
state of the event source object <parameter>source</parameter>. It returns zero if 'floating' mode is
off, positive if it is on.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_event_source_set_floating()</function> and
<function>sd_event_source_get_floating()</function> return a non-negative integer. On failure, they
return a negative errno-style error code.</para>
<refsect2>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para><parameter>source</parameter> is not a valid pointer to an
<structname>sd_event_source</structname> object.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_inotify</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -193,9 +193,9 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_next</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_journal_get_data</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-machined</refentrytitle><manvolnum>8</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_journal_get_data</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -136,36 +136,30 @@ systemd-tmpfiles --create --prefix /var/log/journal</programlisting>
<varlistentry>
<term>SIGUSR1</term>
<listitem><para>Request that journal data from
<filename>/run/</filename> is flushed to
<filename>/var/</filename> in order to make it persistent (if
this is enabled). This must be used after
<filename>/var/</filename> is mounted, as otherwise log data
from <filename>/run</filename> is never flushed to
<filename>/var</filename> regardless of the configuration. The
<command>journalctl --flush</command> command uses this signal
to request flushing of the journal files, and then waits for
<listitem><para>Request that journal data from <filename>/run/</filename> is flushed to
<filename>/var/</filename> in order to make it persistent (if this is enabled). This must be used
after <filename>/var/</filename> is mounted, as otherwise log data from <filename>/run</filename> is
never flushed to <filename>/var</filename> regardless of the configuration. Use the
<command>journalctl --flush</command> command to request flushing of the journal files, and wait for
the operation to complete. See
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
for details.</para></listitem>
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
details.</para></listitem>
</varlistentry>
<varlistentry>
<term>SIGUSR2</term>
<listitem><para>Request immediate rotation of the journal
files. The <command>journalctl --rotate</command> command uses
this signal to request journal file
rotation.</para></listitem>
<listitem><para>Request immediate rotation of the journal files. Use the <command>journalctl
--rotate</command> command to request journal file rotation, and wait for the operation to
complete.</para></listitem>
</varlistentry>
<varlistentry>
<term>SIGRTMIN+1</term>
<listitem><para>Request that all unwritten log data is written
to disk. The <command>journalctl --sync</command> command uses
this signal to trigger journal synchronization, and then waits
for the operation to complete.</para></listitem>
<listitem><para>Request that all unwritten log data is written to disk. Use the <command>journalctl
--sync</command> command to trigger journal synchronization, and wait for the operation to
complete.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -17,7 +17,7 @@
<refnamediv>
<refname>systemd-makefs@.service</refname>
<refname>systemd-makeswap@.service</refname>
<refname>systemd-mkswap@.service</refname>
<refname>systemd-growfs@.service</refname>
<refname>systemd-makefs</refname>
<refname>systemd-growfs</refname>
@ -26,7 +26,7 @@
<refsynopsisdiv>
<para><filename>systemd-makefs@<replaceable>device</replaceable>.service</filename></para>
<para><filename>systemd-makeswap@<replaceable>device</replaceable>.service</filename></para>
<para><filename>systemd-mkswap@<replaceable>device</replaceable>.service</filename></para>
<para><filename>systemd-growfs@<replaceable>mountpoint</replaceable>.service</filename></para>
<para><filename>/usr/lib/systemd/systemd-makefs</filename></para>
<para><filename>/usr/lib/systemd/systemd-growfs</filename></para>
@ -36,7 +36,7 @@
<title>Description</title>
<para><filename>systemd-makefs@.service</filename>,
<filename>systemd-makeswap@.service</filename>, and
<filename>systemd-mkswap@.service</filename>, and
<filename>systemd-growfs@.service</filename> are used to implement the
<option>x-systemd.makefs</option> and <option>x-systemd.growfs</option> options
in <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,

View File

@ -2041,7 +2041,7 @@ SystemCallErrorNumber=EPERM</programlisting>
<varlistentry>
<term><varname>StandardOutput=</varname></term>
<listitem><para>Controls where file descriptor 1 (STDOUT) of the executed processes is connected
<listitem><para>Controls where file descriptor 1 (stdout) of the executed processes is connected
to. Takes one of <option>inherit</option>, <option>null</option>, <option>tty</option>,
<option>journal</option>, <option>kmsg</option>, <option>journal+console</option>,
<option>kmsg+console</option>, <option>file:<replaceable>path</replaceable></option>,
@ -2117,7 +2117,7 @@ SystemCallErrorNumber=EPERM</programlisting>
<varlistentry>
<term><varname>StandardError=</varname></term>
<listitem><para>Controls where file descriptor 2 (STDERR) of the executed processes is connected to. The
<listitem><para>Controls where file descriptor 2 (stderr) of the executed processes is connected to. The
available options are identical to those of <varname>StandardOutput=</varname>, with some exceptions: if set to
<option>inherit</option> the file descriptor used for standard output is duplicated for standard error, while
<option>fd:<replaceable>name</replaceable></option> will use a default file descriptor name of

View File

@ -23,14 +23,13 @@
<refsect1>
<title>Description</title>
<para>Entries in the journal resemble an environment block in
their syntax but with fields that can include binary data.
Primarily, fields are formatted UTF-8 text strings, and binary
formatting is used only where formatting as UTF-8 text strings
makes little sense. New fields may freely be defined by
applications, but a few fields have special meaning. All fields
with special meanings are optional. In some cases, fields may
appear more than once per entry.</para>
<para>Entries in the journal (as written by
<citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>)
resemble a UNIX process environment block in syntax but with fields that may include binary data.
Primarily, fields are formatted UTF-8 text strings, and binary encoding is used only where formatting as
UTF-8 text strings makes little sense. New fields may freely be defined by applications, but a few fields
have special meanings. All fields with special meanings are optional. In some cases, fields may appear
more than once per entry.</para>
</refsect1>
<refsect1>
@ -542,6 +541,7 @@
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,

View File

@ -1373,8 +1373,8 @@
<varlistentry>
<term><varname>IPServiceType=</varname></term>
<listitem>
<para>Takes string; "CS6" or "CS4". Used to set IP service type to CS6 (network control)
or CS4 (Realtime). IPServiceType defaults to CS6 if nothing is specified.</para>
<para>Takes string; <literal>CS6</literal> or <literal>CS4</literal>. Used to set IP
service type to CS6 (network control) or CS4 (Realtime). Defaults to CS6.</para>
</listitem>
</varlistentry>
</variablelist>

View File

@ -843,7 +843,7 @@ static int parse_argv(int argc, char *argv[]) {
#else
case 'g':
case ARG_CASE_SENSITIVE:
return log_error("Compiled without pattern matching support");
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "Compiled without pattern matching support");
#endif
case 'S':
@ -2668,7 +2668,6 @@ int main(int argc, char *argv[]) {
}
finish:
fflush(stdout);
pager_close();
strv_free(arg_file);

View File

@ -1115,7 +1115,6 @@ void server_dispatch_message(
}
int server_flush_to_var(Server *s, bool require_flag_file) {
sd_id128_t machine;
sd_journal *j = NULL;
char ts[FORMAT_TIMESPAN_MAX];
usec_t start;
@ -1142,10 +1141,6 @@ int server_flush_to_var(Server *s, bool require_flag_file) {
start = now(CLOCK_MONOTONIC);
r = sd_id128_get_machine(&machine);
if (r < 0)
return r;
r = sd_journal_open(&j, SD_JOURNAL_RUNTIME_ONLY);
if (r < 0)
return log_error_errno(r, "Failed to read runtime journal: %m");

View File

@ -114,8 +114,6 @@ struct Server {
unsigned n_forward_syslog_missed;
usec_t last_warn_forward_syslog_missed;
uint64_t var_available_timestamp;
usec_t max_retention_usec;
usec_t max_file_usec;
usec_t oldest_file_usec;

View File

@ -322,7 +322,7 @@ int config_parse_dhcp_send_option(
return 0;
}
free(word);
word = mfree(word);
r = extract_first_word(&p, &word, ":", 0);
if (r == -ENOMEM)
return log_oom();

View File

@ -17,6 +17,7 @@
#include "pretty-print.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "user-util.h"
#include "util.h"
@ -35,8 +36,8 @@ static int help(void) {
if (r < 0)
return log_oom();
printf("%s [OPTIONS...] [VARIABLE=VALUE...]\n\n"
"Notify the init system about service status updates.\n\n"
printf("%s [OPTIONS...] [VARIABLE=VALUE...]\n"
"\n%sNotify the init system about service status updates.%s\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --ready Inform the init system about service start-up completion\n"
@ -46,6 +47,7 @@ static int help(void) {
" --booted Check if the system was booted up with systemd\n"
"\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link
);

View File

@ -290,7 +290,7 @@ static int help(void) {
return log_oom();
printf("%1$s [OPTIONS...] [PATH] [ARGUMENTS...]\n\n"
"Spawn a command or OS in a light-weight container.\n\n"
"%5$sSpawn a command or OS in a light-weight container.%6$s\n\n"
" -h --help Show this help\n"
" --version Print version string\n"
" -q --quiet Do not show status information\n"
@ -405,7 +405,9 @@ static int help(void) {
"\nSee the %2$s for details.\n"
, program_invocation_short_name
, link
, ansi_underline(), ansi_normal());
, ansi_underline(), ansi_normal()
, ansi_highlight(), ansi_normal()
);
return 0;
}