Skip to content

Commit

Permalink
Start memcached even if the database is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed Mar 3, 2020
1 parent f88f5e5 commit a69b2c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker-assets/appliance-initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
[ -f /etc/default/evm ] && . /etc/default/evm
[[ -s ${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh ]] && source "${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh"

# Check if memcached is running, if not start it
pidof memcached
test $? -ne 0 && /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1 -d

function create_v2_key() {
V2_KEY=$(ruby -ropenssl -rbase64 -e 'puts Base64.strict_encode64(Digest::SHA256.digest(OpenSSL::Random.random_bytes(32))[0, 32])')
write_v2_key
Expand Down Expand Up @@ -35,10 +39,6 @@ else
su postgres -c "psql -c \"CREATE ROLE root SUPERUSER LOGIN PASSWORD 'smartvm'\""
test $? -ne 0 && echo "!! Failed to inject MIQ root Role" && exit 1

# Check if memcached is running, if not start it
pidof memcached
test $? -ne 0 && /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1 -d

echo "** Starting DB setup"
pushd ${APP_ROOT}
create_v2_key
Expand Down

0 comments on commit a69b2c7

Please sign in to comment.