summaryrefslogtreecommitdiffstats
path: root/src/man/sss_cache.8.xml
blob: 9613ed83c87356f4e9da4de825334d65e6fd1a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<reference>
<title>SSSD Manual pages</title>
<refentry>
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="include/upstream.xml" />

    <refmeta>
        <refentrytitle>sss_cache</refentrytitle>
        <manvolnum>8</manvolnum>
    </refmeta>

    <refnamediv id='name'>
        <refname>sss_cache</refname>
        <refpurpose>perform cache cleanup</refpurpose>
    </refnamediv>

    <refsynopsisdiv id='synopsis'>
        <cmdsynopsis>
            <command>sss_cache</command>
            <arg choice='opt'>
                <replaceable>options</replaceable>
            </arg>
        </cmdsynopsis>
    </refsynopsisdiv>

    <refsect1 id='description'>
        <title>DESCRIPTION</title>
        <para>
            <command>sss_cache</command> invalidates records in SSSD cache.
            Invalidated records are forced to be reloaded from server as soon
            as related SSSD backend is online. Options that invalidate a single
            object only accept a single provided argument.
        </para>
    </refsect1>

    <refsect1 id='options'>
        <title>OPTIONS</title>
        <variablelist remap='IP'>
            <varlistentry>
                <term>
                    <option>-E</option>,<option>--everything</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all cached entries.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-u</option>,<option>--user</option>
                    <replaceable>login</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate specific user.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-U</option>,<option>--users</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all user records. This option overrides
                        invalidation of specific user if it was also set.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-g</option>,<option>--group</option>
                    <replaceable>group</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate specific group.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-G</option>,<option>--groups</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all group records. This option overrides
                        invalidation of specific group if it was also set.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-n</option>,<option>--netgroup</option>
                    <replaceable>netgroup</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate specific netgroup.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-N</option>,<option>--netgroups</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all netgroup records. This option overrides
                        invalidation of specific netgroup if it was also set.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-s</option>,<option>--service</option>
                    <replaceable>service</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate specific service.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-S</option>,<option>--services</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all service records. This option overrides
                        invalidation of specific service if it was also set.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry condition="with_autofs">
                <term>
                    <option>-a</option>,<option>--autofs-map</option>
                    <replaceable>autofs-map</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate specific autofs maps.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry condition="with_autofs">
                <term>
                    <option>-A</option>,<option>--autofs-maps</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all autofs maps. This option overrides
                        invalidation of specific map if it was also set.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry condition="with_ssh">
                <term>
                    <option>-h</option>,<option>--ssh-host</option>
                    <replaceable>hostname</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate SSH public keys of a specific host.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry condition="with_ssh">
                <term>
                    <option>-H</option>,<option>--ssh-hosts</option>
                </term>
                <listitem>
                    <para>
                        Invalidate SSH public keys of all hosts. This option
                        overrides invalidation of SSH public keys of specific
                        host if it was also set.
                    </para>
                </listitem>
            </varlistentry>
           <varlistentry condition="with_sudo">
                <term>
                    <option>-r</option>,<option>--sudo-rule</option>
                    <replaceable>rule</replaceable>
                </term>
                <listitem>
                    <para>
                        Invalidate particular sudo rule.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry condition="with_sudo">
                <term>
                    <option>-R</option>,<option>--sudo-rules</option>
                </term>
                <listitem>
                    <para>
                        Invalidate all cached sudo rules. This option
                        overrides invalidation of specific sudo rule
                        if it was also set.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>
                    <option>-d</option>,<option>--domain</option>
                    <replaceable>domain</replaceable>
                </term>
                <listitem>
                    <para>
                        Restrict invalidation process only to a particular
                        domain.
                    </para>
                </listitem>
            </varlistentry>
            <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="include/param_help.xml" />
        </variablelist>
    </refsect1>

    <refsect1 id='memcache'>
        <title>EFFECTS ON THE FAST MEMORY CACHE</title>
        <para>
            <command>sss_cache</command> also invalidates the memory cache.
            Since the memory cache is a file which is mapped into the memory of
            each process which called SSSD to resolve users or groups the file
            cannot be truncated. A special flag is set in the header of the file
            to indicate that the content is invalid and then the file is
            unlinked by SSSD's NSS responder and a new cache file is created.
            Whenever a process is now doing a new lookup for a user or a group
            it will see the flag, close the old memory cache file and map the
            new one into its memory. When all processes which had opened the old
            memory cache file have closed it while looking up a user or a group
            the kernel can release the occupied disk space and the old memory
            cache file is finally removed completely.
        </para>
        <para>
            A special case is long running processes which are doing user or
            group lookups only at startup, e.g. to determine the name of the
            user the process is running as. For those lookups the memory cache
            file is mapped into the memory of the process. But since there will
            be no further lookups this process would never detect if the memory
            cache file was invalidated and hence it will be kept in memory and
            will occupy disk space until the process stops. As a result calling
            <command>sss_cache</command> might increase the disk usage because
            old memory cache files cannot be removed from the disk because they
            are still mapped by long running processes.
        </para>
        <para>
            A possible work-around for long running processes which are looking
            up users and groups only at startup or very rarely is to run them
            with the environment variable SSS_NSS_USE_MEMCACHE set to "NO" so
            that they won't use the memory cache at all and not map the memory
            cache file into the memory. In general a better solution is to tune
            the cache timeout parameters so that they meet the local
            expectations and calling <command>sss_cache</command> is not needed.
        </para>
    </refsect1>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="include/seealso.xml" />

</refentry>
</reference>