]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-sysusers.xml
a55d9f6a7574678cf05252917579d67ea13db500
[thirdparty/systemd.git] / man / systemd-sysusers.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7
8 This file is part of systemd.
9
10 Copyright 2014 Lennart Poettering
11
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 -->
25
26 <refentry id="systemd-sysusers"
27 xmlns:xi="http://www.w3.org/2001/XInclude">
28
29 <refentryinfo>
30 <title>systemd-sysusers</title>
31 <productname>systemd</productname>
32
33 <authorgroup>
34 <author>
35 <contrib>Developer</contrib>
36 <firstname>Lennart</firstname>
37 <surname>Poettering</surname>
38 <email>lennart@poettering.net</email>
39 </author>
40 </authorgroup>
41 </refentryinfo>
42
43 <refmeta>
44 <refentrytitle>systemd-sysusers</refentrytitle>
45 <manvolnum>8</manvolnum>
46 </refmeta>
47
48 <refnamediv>
49 <refname>systemd-sysusers</refname>
50 <refname>systemd-sysusers.service</refname>
51 <refpurpose>Allocate system users and groups</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <cmdsynopsis>
56 <command>systemd-sysusers</command>
57 <arg choice="opt" rep="repeat">OPTIONS</arg>
58 <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
59 </cmdsynopsis>
60
61 <para><filename>systemd-sysusers.service</filename></para>
62 </refsynopsisdiv>
63
64 <refsect1>
65 <title>Description</title>
66
67 <para><command>systemd-sysusers</command> creates system users and
68 groups, based on the file format and location specified in
69 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
70 </para>
71
72 <para>If invoked with no arguments, it applies all directives from all files
73 found in the directories specified by
74 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
75 When invoked with positional arguments, if option
76 <option>--replace=<replaceable>PATH</replaceable></option> is specified, arguments
77 specified on the command line are used instead of the configuration file
78 <replaceable>PATH</replaceable>. Otherwise, just the configuration specified by
79 the command line arguments is executed. The string <literal>-</literal> may be
80 specified instead of a filename to instruct <command>systemd-sysusers</command>
81 to read the configuration from standard input. If only the basename of a file is
82 specified, all configuration directories are searched for a matching file and
83 the file found that has the highest priority is executed.</para>
84 </refsect1>
85
86 <refsect1>
87 <title>Options</title>
88
89 <para>The following options are understood:</para>
90
91 <variablelist>
92 <varlistentry>
93 <term><option>--root=<replaceable>root</replaceable></option></term>
94 <listitem><para>Takes a directory path as an argument. All
95 paths will be prefixed with the given alternate
96 <replaceable>root</replaceable> path, including config search
97 paths. </para></listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><option>--replace=<replaceable>PATH</replaceable></option></term>
102 <listitem><para>When this option is given, one ore more positional arguments
103 must be specified. All configuration files found in the directories listed in
104 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
105 will be read, and the configuration given on the command line will be
106 handled instead of and with the same priority as the configuration file
107 <replaceable>PATH</replaceable>.</para>
108
109 <para>This option is intended to be used when package installation scripts
110 are running and files belonging to that package are not yet available on
111 disk, so their contents must be given on the command line, but the admin
112 configuration might already exist and should be given higher priority.
113 </para>
114
115 <example>
116 <title>RPM installation script for radvd</title>
117
118 <programlisting>echo 'u radvd - "radvd daemon"' | \
119 systemd-sysusers --replace=/usr/lib/sysusers.d/radvd.conf -</programlisting>
120
121 <para>This will create the radvd user as if
122 <filename>/usr/lib/sysusers.d/radvd.conf</filename> was already on disk.
123 An admin might override the configuration specified on the command line by
124 placing <filename>/etc/sysusers.d/radvd.conf</filename> or even
125 <filename>/etc/sysusers.d/00-overrides.conf</filename>.</para>
126
127 <para>Note that this is the expanded from, and when used in a package, this
128 would be written using a macro with "radvd" and a file containing the
129 configuration line as arguments.</para>
130 </example>
131 </listitem>
132 </varlistentry>
133
134 <varlistentry>
135 <term><option>--inline</option></term>
136 <listitem><para>Treat each positional argument as a separate configuration
137 line instead of a file name.</para></listitem>
138 </varlistentry>
139
140 <xi:include href="standard-options.xml" xpointer="help" />
141 <xi:include href="standard-options.xml" xpointer="version" />
142 </variablelist>
143
144 </refsect1>
145
146 <refsect1>
147 <title>Exit status</title>
148
149 <para>On success, 0 is returned, a non-zero failure code
150 otherwise.</para>
151 </refsect1>
152
153 <refsect1>
154 <title>See Also</title>
155 <para>
156 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
157 <citerefentry><refentrytitle>sysusers.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
158 </para>
159 </refsect1>
160
161 </refentry>