aboutsummaryrefslogtreecommitdiff
path: root/app/seafile/build/mariadb/entrypoint.sh
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-01-16 17:07:01 +0100
committerAlex Auvolat <alex@adnab.me>2021-01-16 17:07:01 +0100
commitc74dc92febd1841c8ea5ff31caab0f941d57527d (patch)
treed05a203d95cac988952799667ec43c327a5d9038 /app/seafile/build/mariadb/entrypoint.sh
parent0c4ee40e01c95d7bf73236cbead5cc261f67eb9d (diff)
downloadinfrastructure-c74dc92febd1841c8ea5ff31caab0f941d57527d.tar.gz
infrastructure-c74dc92febd1841c8ea5ff31caab0f941d57527d.zip
Proposal: reorganize app/ folder by modules
Diffstat (limited to 'app/seafile/build/mariadb/entrypoint.sh')
-rwxr-xr-xapp/seafile/build/mariadb/entrypoint.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/app/seafile/build/mariadb/entrypoint.sh b/app/seafile/build/mariadb/entrypoint.sh
new file mode 100755
index 0000000..7ebf049
--- /dev/null
+++ b/app/seafile/build/mariadb/entrypoint.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+set -e
+
+cat > /etc/nslcd.conf <<EOF
+# /etc/nslcd.conf
+# nslcd configuration file. See nslcd.conf(5)
+# for details.
+
+# The user and group nslcd should run as.
+uid nslcd
+gid nslcd
+
+# The location at which the LDAP server(s) should be reachable.
+uri ${LDAP_URI}
+
+# The search base that will be used for all queries.
+base ${LDAP_BASE}
+
+# The LDAP protocol version to use.
+ldap_version ${LDAP_VERSION}
+
+# The DN to bind with for normal lookups.
+binddn ${LDAP_BIND_DN}
+bindpw ${LDAP_BIND_PW}
+
+# The DN used for password modifications by root.
+#rootpwmoddn cn=admin,dc=example,dc=com
+
+# SSL options
+#ssl off
+#tls_reqcert never
+tls_cacertfile /etc/ssl/certs/ca-certificates.crt
+
+# The search scope.
+#scope sub
+EOF
+
+/usr/sbin/nslcd
+
+chown mysql:mysql /var/lib/mysql
+[ -z "$(ls -A /var/lib/mysql)" ] && mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
+
+/usr/bin/mysqld_safe &
+
+until ls /var/run/mysqld/mysqld.sock; do sleep 1; done
+/usr/bin/mysqladmin -u root password ${MYSQL_PASSWORD} || true
+
+exec "$@"
+