added dbus startup to container [no ci]

This commit is contained in:
iadgovuser26 iadgovuser26@empire.eclipse.ncsc.mil 2023-01-20 21:49:25 +00:00
parent 84ac9e43a6
commit b6aa61272a
3 changed files with 25 additions and 5 deletions

View File

@ -135,11 +135,12 @@ ospackage {
}
// Post Install
postInstall file('../package/scripts/install_tomcat.sh')
postInstall file('../package/scripts/common/db_create.sh')
postInstall 'mkdir -p /etc/hirs/aca/client_files'
postInstall 'mkdir -p /etc/hirs/aca/certificates'
postInstall 'cp /tmp/aca/default-properties/* /opt/hirs/default-properties/.'
postInstall 'rm -rf /tmp/aca/'
postInstall file('../package/scripts/install_tomcat.sh')
// Old post install files, to be removed...
// Note /etc/hirs/aca/certificates files are created by certificate_generate.sh
@ -149,7 +150,6 @@ ospackage {
// /etc/hirs/certificates/private/ files are created by ssl_configure.sh
// postInstall file('../package/scripts/common/firewall_configure_tomcat.sh')
// postInstall file('../package/scripts/common/ssl_configure.sh')
postInstall file('../package/scripts/common/db_create.sh')
// postInstall file('../package/scripts/aca/certificate_generate.sh')
// postInstall 'if [ selinuxenabled ]; then semodule -i /opt/hirs/extras/aca/tomcat-mysql-hirs.pp; fi'

View File

@ -30,10 +30,28 @@ if [[ $(pgrep -c -u mysql mysqld) -eq 0 ]]; then
if [ $DOCKER_CONTAINER = true ]; then
# if in Docker container, avoid services that invoke the D-Bus
echo "ACA is running in a container..."
/usr/bin/mysql_install_db
# Start DBus
mkdir -p /var/run/dbus
if [ -e /var/run/dbus/pid ]; then
rm /var/run/dbus/pid
fi
if [ -e /var/run/dbus/system_bus_socket ]; then
rm /var/run/dbus/system_bus_socket
fi
if [ -e /run/dbus/messagebus.pid ]; then
rm /run/dbus/messagebus.pid
fi
if pgrep dbus ;
then echo "dbus already running";
else
echo "starting dbus";
dbus-daemon --fork --system
fi
echo "starting mariadb"
/usr/bin/mysql_install_db &
chown -R mysql:mysql /var/lib/mysql/
chown -R mysql:mysql /var/log/mariadb/
nohup /usr/bin/mysqld_safe > /dev/null 2>&1 &
/usr/bin/mysqld_safe &
else
SQL_SERVICE=`/opt/hirs/scripts/common/get_db_service.sh`
systemctl $SQL_SERVICE enable

View File

@ -12,4 +12,6 @@ user="root"
pwd=$(prop 'persistence.db.password')
# drop the database
mysql -u "$user" --password="$pwd" < /opt/hirs/scripts/common/db_drop.sql
if pgrep mysqld >/dev/null 2>&1; then
mysql -u "$user" --password="$pwd" < /opt/hirs/scripts/common/db_drop.sql
fi