]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-sysctl.service.xml
creds: Add ImportCredential=
[thirdparty/systemd.git] / man / systemd-sysctl.service.xml
CommitLineData
9393a877
LP
1<?xml version="1.0"?>
2<!--*-nxml-*-->
3a54a157
ZJS
3<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
db9ecf05 5<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
14f01575
FS
6<refentry id="systemd-sysctl.service"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
9393a877 8
798d3a52
ZJS
9 <refentryinfo>
10 <title>systemd-sysctl.service</title>
11 <productname>systemd</productname>
798d3a52 12 </refentryinfo>
9393a877 13
798d3a52
ZJS
14 <refmeta>
15 <refentrytitle>systemd-sysctl.service</refentrytitle>
16 <manvolnum>8</manvolnum>
17 </refmeta>
9393a877 18
798d3a52
ZJS
19 <refnamediv>
20 <refname>systemd-sysctl.service</refname>
21 <refname>systemd-sysctl</refname>
22 <refpurpose>Configure kernel parameters at boot</refpurpose>
23 </refnamediv>
9393a877 24
798d3a52 25 <refsynopsisdiv>
14f01575
FS
26 <cmdsynopsis>
27 <command>/usr/lib/systemd/systemd-sysctl</command>
28 <arg choice="opt" rep="repeat">OPTIONS</arg>
29 <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
30 </cmdsynopsis>
798d3a52 31 <para><filename>systemd-sysctl.service</filename></para>
798d3a52 32 </refsynopsisdiv>
9393a877 33
798d3a52
ZJS
34 <refsect1>
35 <title>Description</title>
9393a877 36
b938cb90 37 <para><filename>systemd-sysctl.service</filename> is an early boot
798d3a52 38 service that configures
3ba3a79d 39 <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
7382a3cc 40 kernel parameters by invoking <command>/usr/lib/systemd/systemd-sysctl</command>.</para>
9393a877 41
7382a3cc
ZJS
42 <para>When invoked with no arguments, <command>/usr/lib/systemd/systemd-sysctl</command> applies
43 all directives from configuration files listed in
44 <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
45 If one or more filenames are passed on the command line, only the directives in these files are
46 applied.</para>
47
48 <para>In addition, <option>--prefix=</option> option may be used to limit which sysctl
49 settings are applied.</para>
14f01575 50
798d3a52 51 <para>See
2d56bdab 52 <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
7382a3cc 53 for information about the configuration of sysctl settings. After sysctl configuration is
3b121157 54 changed on disk, it must be written to the files in <filename>/proc/sys/</filename> before it
7382a3cc
ZJS
55 takes effect. It is possible to update specific settings, or simply to reload all configuration,
56 see Examples below.</para>
798d3a52 57 </refsect1>
9393a877 58
14f01575
FS
59 <refsect1><title>Options</title>
60 <variablelist>
7382a3cc
ZJS
61 <varlistentry id='prefix'>
62 <term><option>--prefix=</option></term>
14f01575
FS
63 <listitem>
64 <para>Only apply rules with the specified prefix.</para>
65 </listitem>
66 </varlistentry>
e88748c1
QD
67 <varlistentry id='strict'>
68 <term><option>--strict=</option></term>
69 <listitem>
70 <para>Always return non-zero exit code on failure (including invalid sysctl variable
71 name and insufficient permissions), unless the sysctl variable name is prefixed with a "-"
72 character.</para>
73 </listitem>
74 </varlistentry>
14f01575 75
3c51c626 76 <xi:include href="standard-options.xml" xpointer="cat-config" />
dcd5c891 77 <xi:include href="standard-options.xml" xpointer="no-pager" />
14f01575
FS
78 <xi:include href="standard-options.xml" xpointer="help" />
79 <xi:include href="standard-options.xml" xpointer="version" />
80
81 </variablelist>
82 </refsect1>
39f0d1d2
LP
83
84 <refsect1>
85 <title>Credentials</title>
86
87 <para><command>systemd-sysctl</command> supports the service credentials logic as implemented by
bbfb25f4
DDM
88 <varname>ImportCredential=</varname>/<varname>LoadCredential=</varname>/<varname>SetCredential=</varname>
89 (see <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
39f0d1d2
LP
90 details). The following credentials are used when passed in:</para>
91
92 <variablelist>
93 <varlistentry>
94 <term><literal>sysctl.extra</literal></term>
95
96 <listitem><para>The contents of this credential may contain additional lines to operate on. The
3acb6ede
LP
97 credential contents should follow the same format as any other <filename>sysctl.d/</filename> drop-in
98 configuration file. If this credential is passed it is processed after all of the drop-in files read
99 from the file system. The settings configured in the credential hence take precedence over those in
100 the file system.</para></listitem>
39f0d1d2
LP
101 </varlistentry>
102 </variablelist>
103
104 <para>Note that by default the <filename>systemd-sysctl.service</filename> unit file is set up to inherit
105 the <literal>sysctl.extra</literal> credential from the service manager.</para>
106 </refsect1>
14f01575 107
7382a3cc
ZJS
108 <refsect1>
109 <title>Examples</title>
110
111 <example>
112 <title>Reset all sysctl settings</title>
113
114 <programlisting>systemctl restart systemd-sysctl</programlisting>
115 </example>
116
117 <example>
118 <title>View coredump handler configuration</title>
119
120 <programlisting># sysctl kernel.core_pattern
121kernel.core_pattern = |/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t %P %I
122</programlisting>
123 </example>
124
125 <example>
126 <title>Update coredump handler configuration</title>
127
128 <programlisting># /usr/lib/systemd/systemd-sysctl --prefix kernel.core_pattern</programlisting>
129
130 <para>This searches all the directories listed in
131 <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
132 for configuration files and writes <filename>/proc/sys/kernel/core_pattern</filename>.</para>
133 </example>
134
135 <example>
136 <title>Update coredump handler configuration according to a specific file</title>
137
138 <programlisting># /usr/lib/systemd/systemd-sysctl 50-coredump.conf</programlisting>
139
140 <para>This applies all the settings found in <filename>50-coredump.conf</filename>.
141 Either <filename>/etc/sysctl.d/50-coredump.conf</filename>, or
142 <filename>/run/sysctl.d/50-coredump.conf</filename>, or
143 <filename>/usr/lib/sysctl.d/50-coredump.conf</filename> will be used, in the order
144 of preference.</para>
145 </example>
146
147 <para>See
148 <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
149 for various ways to directly apply sysctl settings.</para>
150 </refsect1>
151
798d3a52
ZJS
152 <refsect1>
153 <title>See Also</title>
154 <para>
155 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2d56bdab 156 <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
3840b147 157 <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
798d3a52
ZJS
158 </para>
159 </refsect1>
9393a877
LP
160
161</refentry>