updated entrypoint scripts for docker to avoid long wait upon startup over a glusterfs persistent storage

This commit is contained in:
hyung-hwan 2022-09-09 07:00:26 +00:00
parent c4c2646107
commit 1d4761c569
3 changed files with 65 additions and 27 deletions

View File

@ -117,17 +117,30 @@ for e in "${!APACHE_@}"; do
fi
done
[ ! -d /var/lib/codepot/attachments ] && mkdir -p /var/lib/codepot/attachments
[ ! -d /var/lib/codepot/files ] && mkdir -p /var/lib/codepot/files
[ ! -d /var/lib/codepot/issuefiles ] && mkdir -p /var/lib/codepot/issuefiles
[ ! -d /var/lib/codepot/svnrepo ] && mkdir -p /var/lib/codepot/svnrepo
[ ! -d /var/lib/codepot/usericons ] && mkdir -p /var/lib/codepot/usericons
[ ! -f /var/lib/codepot/codepot.db ] && sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db ""
chown nobody:nobody /var/lib/codepot
mkdir -p /var/cache/codepot /var/log/codepot
chown -R nobody:nobody /var/lib/codepot /var/cache/codepot /var/log/codepot
for i in /var/cache/codepot /var/log/codepot \
/var/lib/codepot/attachments \
/var/lib/codepot/files \
/var/lib/codepot/issuefiles \
/var/lib/codepot/svnrepo \
/var/lib/codepot/usericons
do
[ ! -d "$i" ] && {
mkdir -p "$i"
chown nobody:nobody "$i"
}
done
[ ! -f "${CODEPOT_CONFIG_FILE}" ] && cp -pf /etc/codepot/codepot.ini "${CODEPOT_CONFIG_FILE}"
[ ! -f /var/lib/codepot/codepot.db ] && {
sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db ""
chown nobody:nobody /var/lib/codepot/codepot.db
}
[ ! -f "${CODEPOT_CONFIG_FILE}" ] && {
cp -pf /etc/codepot/codepot.ini "${CODEPOT_CONFIG_FILE}"
chown nobody:nobody "${CODEPOT_CONFIG_FILE}"
}
grep -F -q '<Location "/">' /etc/apache2/conf.d/codepot.conf || {
cat <<EOF >> /etc/apache2/conf.d/codepot.conf

View File

@ -117,17 +117,30 @@ for e in "${!APACHE_@}"; do
fi
done
[ ! -d /var/lib/codepot/attachments ] && mkdir -p /var/lib/codepot/attachments
[ ! -d /var/lib/codepot/files ] && mkdir -p /var/lib/codepot/files
[ ! -d /var/lib/codepot/issuefiles ] && mkdir -p /var/lib/codepot/issuefiles
[ ! -d /var/lib/codepot/svnrepo ] && mkdir -p /var/lib/codepot/svnrepo
[ ! -d /var/lib/codepot/usericons ] && mkdir -p /var/lib/codepot/usericons
[ ! -f /var/lib/codepot/codepot.db ] && sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db ""
chown www-data:www-data /var/lib/codepot
mkdir -p /var/cache/codepot /var/log/codepot
chown -R www-data:www-data /var/lib/codepot /var/cache/codepot /var/log/codepot
for i in /var/cache/codepot /var/log/codepot \
/var/lib/codepot/attachments \
/var/lib/codepot/files \
/var/lib/codepot/issuefiles \
/var/lib/codepot/svnrepo \
/var/lib/codepot/usericons
do
[ ! -d "$i" ] && {
mkdir -p "$i"
chown www-data:www-data "$i"
}
done
[ ! -f "${CODEPOT_CONFIG_FILE}" ] && cp -pf /etc/codepot/codepot.ini "${CODEPOT_CONFIG_FILE}"
[ ! -f /var/lib/codepot/codepot.db ] && {
sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db ""
chown www-data:www-data /var/lib/codepot/codepot.db
}
[ ! -f "${CODEPOT_CONFIG_FILE}" ] && {
cp -pf /etc/codepot/codepot.ini "${CODEPOT_CONFIG_FILE}"
chown www-data:www-data "${CODEPOT_CONFIG_FILE}"
}
grep -F -q '<Location "/">' /etc/apache2/conf-enabled/codepot.conf || {
cat <<EOF >> /etc/apache2/conf-enabled/codepot.conf

View File

@ -116,18 +116,30 @@ for e in "${!APACHE_@}"; do
fi
done
chown apache:apache /var/lib/codepot
[ ! -d /var/lib/codepot/attachments ] && mkdir -p /var/lib/codepot/attachments
[ ! -d /var/lib/codepot/files ] && mkdir -p /var/lib/codepot/files
[ ! -d /var/lib/codepot/issuefiles ] && mkdir -p /var/lib/codepot/issuefiles
[ ! -d /var/lib/codepot/svnrepo ] && mkdir -p /var/lib/codepot/svnrepo
[ ! -d /var/lib/codepot/usericons ] && mkdir -p /var/lib/codepot/usericons
[ ! -f /var/lib/codepot/codepot.db ] && sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db ""
for i in /var/cache/codepot /var/log/codepot \
/var/lib/codepot/attachments \
/var/lib/codepot/files \
/var/lib/codepot/issuefiles \
/var/lib/codepot/svnrepo \
/var/lib/codepot/usericons
do
[ ! -d "$i" ] && {
mkdir -p "$i"
chown apache:apache "$i"
}
done
mkdir -p /var/cache/codepot /var/log/codepot
chown -R apache:apache /var/lib/codepot /var/cache/codepot /var/log/codepot
[ ! -f /var/lib/codepot/codepot.db ] && {
sqlite3 -init /etc/codepot/codepot.sqlite /var/lib/codepot/codepot.db ""
chown apache:apache /var/lib/codepot/codepot.db
}
[ ! -f "${CODEPOT_CONFIG_FILE}" ] && cp -pf /etc/codepot/codepot.ini "${CODEPOT_CONFIG_FILE}"
[ ! -f "${CODEPOT_CONFIG_FILE}" ] && {
cp -pf /etc/codepot/codepot.ini "${CODEPOT_CONFIG_FILE}"
chown apache:apache "${CODEPOT_CONFIG_FILE}"
}
grep -F -q 'env[CODEPOT_CONFIG_FILE]' /etc/php-fpm.d/www.conf || {
echo "env[CODEPOT_CONFIG_FILE] = ${CODEPOT_CONFIG_FILE}" >> /etc/php-fpm.d/www.conf