Whamcloud - gitweb
FIX: proofed against origional
[doc/manual.git] / LustreProgrammingInterfaces.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter version="5.0" xml:lang="en-US" xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" xml:id='lustreprogramminginterfaces'>
3   <info>
4     <title xml:id='lustreprogramminginterfaces.title'>Lustre Programming Interfaces</title>
5   </info>
6   <para>This chapter describes public programming interfaces to control various aspects of Lustre from userspace. These interfaces are generally not guaranteed to remain unchanged over time, although we will make an effort to notify the user community well in advance of major changes. This chapter includes the following section:</para>
7
8   <itemizedlist><listitem>
9       <para><xref linkend="dbdoclet.50438291_32926"/></para>
10     </listitem>
11
12 <listitem>
13       <para><xref linkend="dbdoclet.50438291_73963"/></para>
14     </listitem>
15
16 </itemizedlist>
17
18           <note><para>Lustre programming interface man pages are found in the lustre/doc folder.</para></note>
19
20     <section xml:id="dbdoclet.50438291_32926">
21       <title>33.1 User/Group <anchor xml:id="dbdoclet.50438291_marker-1293215" xreflabel=""/>Cache Upcall</title>
22       <para>This section describes user and group upcall.</para>
23               <note><para>For information on a universal UID/GID, see <link xl:href="InstallingLustre.html#50438261_19503">Environmental Requirements</link>.</para></note>
24
25       <section remap="h3">
26         <title>33.1.1 Name</title>
27         <para>Use /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_upcall to look up a given user's group membership.</para>
28       </section>
29       <section remap="h3">
30         <title>33.1.2 Description</title>
31         <para>The group upcall file contains the path to an executable that, when installed, is invoked to resolve a numeric UID to a group membership list. This utility should complete the mds_grp_downcall_data data structure (see <link xl:href="LustreProgrammingInterfaces.html#50438291_33759">Data Structures</link>) and write it to the /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_info pseudo-file.</para>
32         <para>For a sample upcall program, see lustre/utils/l_getgroups.c in the Lustre source distribution.</para>
33         <section remap="h4">
34           <title>33.1.2.1 Primary and Secondary Groups</title>
35           <para>The mechanism for the primary/secondary group is as follows:</para>
36           <itemizedlist><listitem>
37               <para> The MDS issues an upcall (set per MDS) to map the numeric UID to the supplementary group(s).</para>
38             </listitem>
39
40 <listitem>
41               <para> If there is no upcall or if there is an upcall and it fails, supplementary groups will be added as supplied by the client (as they are now).</para>
42             </listitem>
43
44 <listitem>
45               <para> The default upcall is /usr/sbin/l_getidentity, which can interact with the user/group database to obtain UID/GID/suppgid. The user/group database depends on authentication configuration, and can be local /etc/passwd, NIS, LDAP, etc. If necessary, the administrator can use a parse utility to set /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_upcall. If the upcall interface is set to NONE, then upcall is disabled. The MDS uses the UID/GID/suppgid supplied by the client.</para>
46             </listitem>
47
48 <listitem>
49               <para> The default group upcall is set by mkfs.lustre. Use tunefs.lustre --param or echo{path}&gt;/proc/fs/lustre/mds/{mdsname}/group_upcall</para>
50             </listitem>
51
52 <listitem>
53               <para> The Lustre administrator can specify permissions for a specific UID by configuring /etc/lustre/perm.conf on the MDS. As commented in lustre/utils/l_getidentity.c</para>
54             </listitem>
55
56 </itemizedlist>
57           <screen>/** permission file format is like this: * {nid} {uid} {perms} * * &apos;*&apos; nid \
58 means any nid* &apos;*&apos; uid means any uid* the valid values for perms are:* setu\
59 id/setgid/setgrp/rmtacl -- enable corresponding perm* nosetuid/nosetgid/nos\
60 etgrp/normtacl -- disable corresponding perm* they can be listed together, \
61 seperated by &apos;,&apos;,* when perm and noperm are in the same line (item), noperm\
62  is preferential,* when they are in different lines (items), the latter is \
63 preferential,* &apos;*&apos; nid is as default perm, and is not preferential.*/
64 </screen>
65           <para>Currently, rmtacl/normtacl can be ignored (part of security functionality), and used for remote clients. The /usr/sbin/l_getidentity utility can parse /etc/lustre/perm.conf to obtain permission mask for specified UID.</para>
66           <itemizedlist><listitem>
67               <para> To avoid repeated upcalls, the MDS caches supplemental group information. Use /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_expire to set the cache time (default is 600 seconds). The kernel waits for the upcall to complete (at most, 5 seconds) and takes the &quot;failure&quot; behavior as described. Set the wait time in /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_acquire_expire (default is 15 seconds). Cached entries are flushed by writing to /proc/fs/lustre/mdt/${FSNAME}-MDT{xxxx}/identity_flush.</para>
68             </listitem>
69
70 </itemizedlist>
71         </section>
72       </section>
73       <section remap="h3">
74         <title>33.1.3 Parameters</title>
75         <itemizedlist><listitem>
76             <para> Name of the MDS service</para>
77           </listitem>
78
79 <listitem>
80             <para> Numeric UID</para>
81           </listitem>
82
83 </itemizedlist>
84       </section>
85       <section remap="h3">
86         <title>33.1.4 <anchor xml:id="dbdoclet.50438291_33759" xreflabel=""/>Data Structures</title>
87         <screen>struct identity_downcall_data {
88    __u32           idd_magic;
89    __u32           idd_err;
90    __u32           idd_uid;
91    __u32           idd_gid;
92    __u32           idd_nperms;
93    struct perm_downcall_data idd_perms[N_PERMS_MAX];
94    __u32           idd_ngroups;
95    __u32           idd_groups[0];
96 };
97 </screen>
98       </section>
99     </section>
100     <section xml:id="dbdoclet.50438291_73963">
101       <title>33.2 l_getgroups<anchor xml:id="dbdoclet.50438291_marker-1294565" xreflabel=""/> Utility</title>
102       <para>The l_getgroups utility handles Lustre user/group cache upcall.</para>
103       <section remap="h5">
104         <title>Synopsis</title>
105         <screen>l_getgroups [-v] [-d|mdsname] uid]
106 l_getgroups [-v] -s
107 </screen>
108       </section>
109       <section remap="h5">
110         <title>Description</title>
111         <para>The group upcall file contains the path to an executable that, when properly installed, is invoked to resolve a numeric UID to a group membership list. This utility should complete the mds_grp_downcall_data data structure (see Data structures) and write it to the /proc/fs/lustre/mds/mds-service/group_info pseudo-file.</para>
112         <para>l_getgroups is the reference implementation of the user/group cache upcall.</para>
113       </section>
114       <section remap="h5">
115         <title>Files</title>
116         <para>/proc/fs/lustre/mds/mds-service/group_upcall</para>
117       </section>
118   </section>
119 </chapter>