]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-sysusers.xml
travis: use UBSan checks from OSS-Fuzz
[thirdparty/systemd.git] / man / systemd-sysusers.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
5
6 <refentry id="systemd-sysusers"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>systemd-sysusers</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>systemd-sysusers</refentrytitle>
16 <manvolnum>8</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>systemd-sysusers</refname>
21 <refname>systemd-sysusers.service</refname>
22 <refpurpose>Allocate system users and groups</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <cmdsynopsis>
27 <command>systemd-sysusers</command>
28 <arg choice="opt" rep="repeat">OPTIONS</arg>
29 <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
30 </cmdsynopsis>
31
32 <para><filename>systemd-sysusers.service</filename></para>
33 </refsynopsisdiv>
34
35 <refsect1>
36 <title>Description</title>
37
38 <para><command>systemd-sysusers</command> creates system users and
39 groups, based on the file format and location specified in
40 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
41 </para>
42
43 <para>If invoked with no arguments, it applies all directives from all files
44 found in the directories specified by
45 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
46 When invoked with positional arguments, if option
47 <option>--replace=<replaceable>PATH</replaceable></option> is specified, arguments
48 specified on the command line are used instead of the configuration file
49 <replaceable>PATH</replaceable>. Otherwise, just the configuration specified by
50 the command line arguments is executed. The string <literal>-</literal> may be
51 specified instead of a filename to instruct <command>systemd-sysusers</command>
52 to read the configuration from standard input. If only the basename of a file is
53 specified, all configuration directories are searched for a matching file and
54 the file found that has the highest priority is executed.</para>
55 </refsect1>
56
57 <refsect1>
58 <title>Options</title>
59
60 <para>The following options are understood:</para>
61
62 <variablelist>
63 <varlistentry>
64 <term><option>--root=<replaceable>root</replaceable></option></term>
65 <listitem><para>Takes a directory path as an argument. All
66 paths will be prefixed with the given alternate
67 <replaceable>root</replaceable> path, including config search
68 paths. </para></listitem>
69 </varlistentry>
70
71 <varlistentry>
72 <term><option>--replace=<replaceable>PATH</replaceable></option></term>
73 <listitem><para>When this option is given, one ore more positional arguments
74 must be specified. All configuration files found in the directories listed in
75 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
76 will be read, and the configuration given on the command line will be
77 handled instead of and with the same priority as the configuration file
78 <replaceable>PATH</replaceable>.</para>
79
80 <para>This option is intended to be used when package installation scripts
81 are running and files belonging to that package are not yet available on
82 disk, so their contents must be given on the command line, but the admin
83 configuration might already exist and should be given higher priority.
84 </para>
85
86 <example>
87 <title>RPM installation script for radvd</title>
88
89 <programlisting>echo 'u radvd - "radvd daemon"' | \
90 systemd-sysusers --replace=/usr/lib/sysusers.d/radvd.conf -</programlisting>
91
92 <para>This will create the radvd user as if
93 <filename>/usr/lib/sysusers.d/radvd.conf</filename> was already on disk.
94 An admin might override the configuration specified on the command line by
95 placing <filename>/etc/sysusers.d/radvd.conf</filename> or even
96 <filename>/etc/sysusers.d/00-overrides.conf</filename>.</para>
97
98 <para>Note that this is the expanded form, and when used in a package, this
99 would be written using a macro with "radvd" and a file containing the
100 configuration line as arguments.</para>
101 </example>
102 </listitem>
103 </varlistentry>
104
105 <varlistentry>
106 <term><option>--inline</option></term>
107 <listitem><para>Treat each positional argument as a separate configuration
108 line instead of a file name.</para></listitem>
109 </varlistentry>
110
111 <xi:include href="standard-options.xml" xpointer="cat-config" />
112 <xi:include href="standard-options.xml" xpointer="no-pager" />
113 <xi:include href="standard-options.xml" xpointer="help" />
114 <xi:include href="standard-options.xml" xpointer="version" />
115 </variablelist>
116
117 </refsect1>
118
119 <refsect1>
120 <title>Exit status</title>
121
122 <para>On success, 0 is returned, a non-zero failure code
123 otherwise.</para>
124 </refsect1>
125
126 <refsect1>
127 <title>See Also</title>
128 <para>
129 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
130 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
131 <ulink url="https://systemd.io/UIDS-GIDS">Users, Groups, UIDs and GIDs on systemd systems</ulink>
132 </para>
133 </refsect1>
134
135 </refentry>