![Pete Vander Giessen](/assets/img/avatar_default.png)
* Added install hooks for keystone. * Fixed merge conflicts related to mysql reorg. * Resolved more mysql merge conflicts. * Resolved merge conflicts related to rabbitmq refactor. * Added configure-the-things script to tests * Turned off horizon for now. * Disabled a bunch of daemons -- can reenable one by one as we verify them to be working. * Added configure script, but exit 0 before configuring mysql -- there's something broken about the pathing. * Fixed stray 'sudo' in configure hook, which was causing problems. * Split uwsgi daemons into service specific directories Enable all daemons again. * Add .d configuration for nova, keystone and glance * Misc updates * Drop nova-consoleauth as its deprecated at rocky * Rename neutron-manage -> neutron-db-manage * Add neutron and nova hypervisor agents and configuration * Add configuration files for new agents * Update worker configuration * Add libvirt support to nova parts * Add fake sudo command to unconfuse things
65 lines
2.1 KiB
Bash
Executable File
65 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
install -D $SNAP/var/snap/microstack/common/libvirt/libvirtd.conf $SNAP_COMMON/libvirt/libvirtd.conf
|
|
sed -i 's/unix_sock_group = "libvirtd"/unix_sock_group = "sudo"/' $SNAP_COMMON/libvirt/libvirtd.conf
|
|
|
|
# Mysql setup script
|
|
set -e
|
|
init_config() {
|
|
mkdir "${CONFDIR}"
|
|
echo "Generating config file in ${CONFFILE}..."
|
|
touch "${CONFFILE}"
|
|
echo "[mysqld]" >> ${CONFFILE}
|
|
echo "pid-file=${RUNDIR}/mysqld.pid" >> ${CONFFILE}
|
|
echo "socket=${RUNDIR}/mysqld.sock" >> ${CONFFILE}
|
|
echo "datadir=${DATADIR}" >> ${CONFFILE}
|
|
echo "log-error=${LOGDIR}/error.log" >> ${CONFFILE}
|
|
echo "secure-file-priv=${FILESDIR}" >> ${CONFFILE}
|
|
echo "basedir=${BASEDIR}" >> ${CONFFILE}
|
|
echo "[mysql]" >> ${CONFFILE}
|
|
echo "socket=${RUNDIR}/mysqld.sock" >> ${CONFFILE}
|
|
echo "Done"
|
|
}
|
|
|
|
init_database() {
|
|
echo "Initializing new database in ${DATADIR}..."
|
|
mkdir "${DATADIR}"
|
|
mysqld --defaults-file="${CONFFILE}" --initialize
|
|
echo "Done"
|
|
cat ${LOGDIR}/error.log | grep "temporary password"
|
|
}
|
|
|
|
USERID=$(id -u)
|
|
if [ "${USERID}" = "0" ];then
|
|
MYSQL_SNAPDIR="${SNAP_COMMON}"
|
|
else
|
|
MYSQL_SNAPDIR="${SNAP_USER_COMMON}"
|
|
fi
|
|
DATADIR="${MYSQL_SNAPDIR}/data"
|
|
RUNDIR="${MYSQL_SNAPDIR}/run"
|
|
LOGDIR="${MYSQL_SNAPDIR}/log"
|
|
CONFDIR="${MYSQL_SNAPDIR}/conf"
|
|
CONFFILE="${CONFDIR}/my.cnf"
|
|
FILESDIR="${MYSQL_SNAPDIR}/files"
|
|
BASEDIR="${SNAP}/usr"
|
|
|
|
[ -d "${LOGDIR}" ] || mkdir "${LOGDIR}"
|
|
[ -f "${LOGDIR}/error.log" ] || touch "${LOGDIR}/error.log"
|
|
[ -d "${FILESDIR}" ] || mkdir "${FILESDIR}"
|
|
[ -d "${RUNDIR}" ] || mkdir "${RUNDIR}"
|
|
[ -d "${CONFDIR}" ] || init_config
|
|
[ -d "${DATADIR}" ] || init_database
|
|
|
|
if [ "${USERID}" = "0" ];
|
|
then
|
|
# Ensure mysql user exists and that the correct permissions are set on various directories
|
|
getent group mysql || addgroup mysql
|
|
adduser --system --disabled-login --ingroup mysql --home /nonexistent --gecos "MySQL Server" --shell /bin/false mysql >/dev/null
|
|
chown -R mysql:mysql "${LOGDIR}" "${FILESDIR}" "${DATADIR}" "${RUNDIR}"
|
|
chmod 750 "${LOGDIR}" "${DATADIR}"
|
|
chmod 770 "${FILESDIR}"
|
|
chmod 755 "${RUNDIR}"
|
|
VARS="--user=mysql"
|
|
fi
|