New UDB

From techdocs
Revision as of 10:22, 29 August 2023 by Plinich (talk | contribs)
Jump to navigation Jump to search

Like the Old UDB, the New UDB is a user database providing Linux account information to hosts and workstations. It also implements a hierarchical class-membership structure which both allows users' roles in the school to be established, and also controls user access to certain resources. Additionally, the same database hosting its tables also contains tables supporting the operation of CSE's mlalias mail-forwarding and mailing-lists system. Both systems' database tables are loosely coupled.

The New UDB:

  1. Runs primarily on the host bandleader,
  2. Uses PostgreSQL for its database
  3. Uses an OpenLDAP server on the same server to "feed" hosts and workstations with account information (UID, GID, etc.). The contents of the OpenLDAP server's database are synch'd with the contents of the PostgreSQL database multiple times per hour

Operations

To access the PostgreSQL database:

  1. Log on to bandleader as root,
  2. su - ldapudb (ignore error/warning about findmnt)
  3. psql xcse (xcse is the database containing both the UDB and the mlalias tables)

Database tables

The listing below shows the tables in the xcse database, namely the database containing the tables supporting the UDB and mlalias.

  • Red is UDB
  • Green is mlalias
  • Gray tables are unused. These are left over from an attempt to use an LDAP translator to respond to client LDAP requests by directly querying the database, instead of using OpenLDAP (as we finally did due to querying the database being way too slow, most notably due to the recursion required for class membership lookups).
bandleader % psql xcse
psql (9.4.6)
Type "help" for help.

xcse=# \dt
                 List of relations
 Schema |          Name          | Type  |  Owner   
--------+------------------------+-------+----------
 public | group_member_table     | table | postgres
 public | group_membership_list  | table | postgres
 public | group_table            | table | postgres
 public | ldap_all_names_by_user | table | ldapif
 public | ldap_classes_by_user   | table | ldapif
 public | ldap_groups_by_user    | table | ldapif
 public | ldap_user_table        | table | ldapif
 public | ldap_users_by_class    | table | ldapif
 public | ldap_users_by_group    | table | ldapif
 public | mlalias_address        | table | postgres
 public | mlalias_control        | table | postgres
 public | mlalias_owner          | table | postgres
 public | mlalias_sender         | table | postgres
 public | mlalias_user_external  | table | ldapudb
 public | nisnetgroup_table      | table | postgres
 public | user_alias_table       | table | postgres
 public | user_group_table       | table | postgres
 public | user_table             | table | postgres
(18 rows)

xcse=#