Use lxc start/stop commands in install script instead of service

This commit is contained in:
Disassembler 2019-02-26 21:08:42 +01:00
parent 3f6a74b5bd
commit 3a424c5726
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 5 additions and 4 deletions

View File

@ -25,12 +25,13 @@ rc-update -u
# Populate database
>/var/log/lxc/mifosx.log
service mifosx start
lxc-start mifosx
until grep -q 'org.apache.catalina.startup.Catalina.start Server startup' /var/log/lxc/mifosx.log; do
sleep 1
done
service mifosx stop
lxc-stop mifosx
# Fix missing previous_run_status column
# TODO: Remove?
#echo 'ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;' | lxc-attach mariadb -- mysql mifostenant-default
# Update admin account

View File

@ -24,7 +24,7 @@ cp etc/init.d/motech /etc/init.d/motech
rc-update -u
# Populate database and create admin account
service motech start
lxc-start motech
until curl -s "http://motech:8080/module/server/startup/" | grep -q adminLogin; do
sleep 1
done
@ -32,7 +32,7 @@ export MOTECH_ADMIN_USER="admin"
export MOTECH_ADMIN_EMAIL="admin@example.com"
export MOTECH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
curl -H "Content-Type: application/json" -X POST -d "{\"adminLogin\":\"${MOTECH_ADMIN_USER}\",\"adminEmail\":\"${MOTECH_ADMIN_EMAIL}\",\"adminPassword\":\"${MOTECH_ADMIN_PWD}\",\"adminConfirmPassword\":\"${MOTECH_ADMIN_PWD}\",\"language\":\"cs\",\"providerName\":\"\",\"providerUrl\":\"\",\"schedulerUrl\":\"\"}" http://motech:8080/module/server/startup/
service motech stop
lxc-stop motech
# Install config update script
cp srv/motech/update-conf.sh /srv/motech/update-conf.sh