]> Git — Sourcephile - sourcephile-nix.git/blob - install/logical/friot/sldapd/init.sh
virtualbox: load kernel modules
[sourcephile-nix.git] / install / logical / friot / sldapd / init.sh
1 #! /bin/sh
2 set -eux
3 SLAPD_USER=openldap
4 SLAPD_GROUP=$SLAPD_USER
5 SLAPD_CONF=/etc/ldap/slapd.d
6
7 sudo systemctl stop slapd
8
9 sudo rm -rf \
10 $SLAPD_CONF/cn=config \
11 $SLAPD_CONF/cn=config.ldif \
12 /var/lib/ldap
13 sudo install -D -d -o $SLAPD_USER -g $SLAPD_GROUP -m 0700 \
14 $SLAPD_CONF \
15 /var/lib/ldap \
16 sudo install -D -d -o $SLAPD_USER -g $SLAPD_GROUP -m 0711 \
17 /run/slapd
18 sudo -u $SLAPD_USER -g $SLAPD_GROUP \
19 strace -f -e open slapadd -d 3 -F "$SLAPD_CONF" -b "cn=config" -l ./cn=config.ldif
20 sudo -u $SLAPD_USER -g $SLAPD_GROUP \
21 slapadd -F "$SLAPD_CONF" -b "dc=commonsoft" -l ./dc=commonsoft.ldif
22
23 #sudo systemctl start slapd
24 sudo slapd -d 'ACL' -h 'ldap:/// ldapi:///' -g openldap -u openldap -F /etc/ldap/slapd.d