man: document systemd-sysctl --save= and --revert=

This commit is contained in:
Yu Watanabe
2026-08-21 00:50:02 +09:00
parent 80e346af74
commit 5e2d9c6ed1
+45
View File
@@ -110,6 +110,31 @@
<xi:include href="version-info.xml" xpointer="v259"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--save=<replaceable>FILENAME</replaceable></option></term>
<listitem>
<para>Before applying the loaded sysctl settings, write them to <filename>/run/sysctl.d/</filename>
using the specified filename. If the filename does not end with <filename>.conf</filename>, the
suffix is appended. This option requires one or more positional arguments. May be combined with
<option>--inline</option>. This may be useful for creating runtime sysctl configuration files or
overriding existing sysctl configuration files.</para>
<xi:include href="version-info.xml" xpointer="v262"/>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--revert=<replaceable>FILENAME</replaceable></option></term>
<listitem>
<para>Before loading and applying the sysctl settings, removes the specified sysctl configuration
file under <filename>/run/sysctl.d/</filename>. If the filename does not end with
<filename>.conf</filename>, the suffix is appended. This may be useful for removing configuration
files created by <option>--save=</option>.</para>
<xi:include href="version-info.xml" xpointer="v262"/>
</listitem>
</varlistentry>
<xi:include href="standard-options.xml" xpointer="cat-config" />
<xi:include href="standard-options.xml" xpointer="tldr" />
<xi:include href="standard-options.xml" xpointer="no-pager" />
@@ -186,6 +211,26 @@ kernel.core_pattern = |/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t %P %I
of preference.</para>
</example>
<example>
<title>Disable IPv6 on an interface and save the specified setting</title>
<programlisting># /usr/lib/systemd/systemd-sysctl --save=99-disable-ipv6-foo - &lt;&lt;EOF
net.ipv6.conf.foo.disable_ipv6=1
EOF</programlisting>
<para>This disables IPv6 on the network interface <filename>foo</filename>, and creates
<filename>/run/sysctl.d/99-disable-ipv6-foo.conf</filename>.</para>
</example>
<example>
<title>Remove a runtime sysctl configuration file</title>
<programlisting># /usr/lib/systemd/systemd-sysctl --revert=99-disable-ipv6-foo --prefix=/net/ipv6/conf/foo</programlisting>
<para>This removes <filename>/run/sysctl.d/99-disable-ipv6-foo.conf</filename>, and applies the
remaining sysctl settings for the network interface <filename>foo</filename>.</para>
</example>
<para>See
<citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
for various ways to directly apply sysctl settings.</para>