aboutsummaryrefslogtreecommitdiff
path: root/scripts/hostname/nfs1
blob: 98d5bcce0179c67a111c7d4b050b3e877dba16f7 (plain) (blame)
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
#!/bin/sh

homedir_priv_quota=250G
homedir_pub_quota=10G

create_dataset "${nfs_dataset}/user"
create_dataset "${nfs_dataset}/group"

for user in ${nfs_homedirs:-}; do
  create_dataset "${nfs_dataset}/user/${user}"
  create_dataset "${nfs_dataset}/user/${user}/priv"
  create_dataset "${nfs_dataset}/user/${user}/pub"

  zfs set "refquota=${homedir_priv_quota}" "${nfs_dataset}/user/${user}/priv"
  zfs set "refquota=${homedir_pub_quota}"  "${nfs_dataset}/user/${user}/pub"

  chown "${user}:${user}" \
    "${nfs_root}/user/${user}/priv" \
    "${nfs_root}/user/${user}/pub"

  chmod 700 "${nfs_root}/user/${user}/priv"
  chmod 755 "${nfs_root}/user/${user}/pub"
done

  ldap_add "automountKey=*,automountMapName=auto_home,${automount_basedn}" <<EOF
objectClass: automount
automountKey: *
automountInformation: -nfsv4,gssname=host,sec=krb5p ${fqdn}:/user/&/priv
EOF