File config.sh of Package mash-image-docker

#!/bin/bash

set -ex

test -f /.kconfig && . /.kconfig

#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."

#======================================
# Create ssh machine keys
#--------------------------------------
/usr/sbin/sshd-gen-keys-start

#======================================
# Setup mash working directories
#--------------------------------------
mkdir -p /var/lib/mash/credentials/
mkdir -p /var/lib/mash/database/
mkdir -p /var/lib/mash/images/
mkdir -p /var/lib/mash/ipa/results
mkdir -p /var/lib/mash/.config/ipa
chown -R mash:mash /var/lib/mash/

#======================================
# Setup masher home permissions
#--------------------------------------
chown -R masher:users /home/masher

#======================================
# Enable rabbitmq management console
#--------------------------------------
# Optional, maybe later, setup requires more steps
# rabbitmq-plugins enable rabbitmq_management

#======================================
# Activate services
#--------------------------------------
for service in \
    rabbitmq-server \
    apache2 \
    mash_admin_user \
    mash_job_user \
    mash_cleanup \
    mash_create \
    mash_database_migration \
    mash_deprecate \
    mash_download \
    mash_job_creator \
    mash_log_setup \
    mash_logger \
    mash_publish \
    mash_raw_image_upload \
    mash_replicate \
    mash_test \
    mash_upload \
    sshd
do 
    systemctl enable "${service}"
done

#======================================
# Mask services
#--------------------------------------
for service in \
    sys-kernel-config.mount \
    sys-kernel-debug.mount \
    sys-kernel-tracing.mount
do
    systemctl mask "${service}"
done
openSUSE Build Service is sponsored by