Stop app before uninstalling

This commit is contained in:
Disassembler 2018-10-31 10:21:42 +01:00
parent cdb74d9677
commit b76a350d7b
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 2 additions and 1 deletions

View File

@ -121,6 +121,7 @@ class AppMgr:
def uninstall_app(self, item):
# Main uninstallation function. Wrapper for uninstall script, filesystem purge and unregistration
self.stop_app(item)
deps = self.get_install_deps(item.app, False)[::-1]
for dep in deps:
if dep not in self.get_uninstall_deps():

View File

@ -8,7 +8,7 @@ rc-update -u
# Drop database and user
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
echo 'DROP DATABASE cts; DROP ROLE cts;' | lxc-attach -u 5432 -g 5432 postgres -- psql
echo 'DROP DATABASE IF EXISTS cts; DROP ROLE IF EXISTS cts;' | lxc-attach -u 5432 -g 5432 postgres -- psql
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
exit 0