Files
Loading_Program/README.md
T
2026-10-14 00:43:47 -07:00

1.8 KiB

Loading_Program

Guns. Lots of guns.

Loading Program is a Rust binary which makes an LDAP request to the Samba AD DC and returns information on users in the lab-committee group creates home directories in the Stockroom NFS for those users.

The main challenge this program aims to address is the conflict between the AutoFS daemon owning the directories pam_mkhomedir.so is trying to make home directories in. Since AutoFS maps the CephFS directory /mnt/stockroom/homes to /homes on configured machines, pam_mkhomedir.so (the pam module which creates home directories for first-time users who do not have them) fails and the user has no workspace. By using a separate program with the right capabilities to make home directories on behalf of the PAM module, it doesn't get a chance to fail.

Process flow

Loading Program is a binary. When ran, it performs the following actions:

  1. Parse the configuration file found in /etc/loading-program/config.toml
  • This informs the program on variables such as ldap_uri, bind_dn, bind_password_file, base_dn, group_dn, homes_dir, skel_dir, and require_cephfs.
  1. Check Stockroom is mounted.

  2. Make a LDAP request to Samba AD DC and return attributes such as sAMAccountName, unixHomeDirectory, uidNumber, and gidNumber.

  • These attributes are used to structure the commands to create the appropriate home directory in Stockroom.
  1. Create home directory, including setting adequate directory permissions and copying in a skeleton file template.

Automation

Systemd unit files are included in the systemd directory of this repository. These are used to trigger and log runs of Loading Program, as well as automate runs of the program via a timer unit file.

Privileged users may manually trigger Loading Program using systemd (recommended) or by running the binary and specifying the arguments appropriately.