From b76a350d7b23e82661c255a906a1a51ee3cd4fa5 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 31 Oct 2018 10:21:42 +0100 Subject: [PATCH] Stop app before uninstalling --- basic/srv/vm/mgr/appmgr.py | 1 + cts/uninstall.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/basic/srv/vm/mgr/appmgr.py b/basic/srv/vm/mgr/appmgr.py index d953dc3..4d31c24 100644 --- a/basic/srv/vm/mgr/appmgr.py +++ b/basic/srv/vm/mgr/appmgr.py @@ -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(): diff --git a/cts/uninstall.sh b/cts/uninstall.sh index 5475ba9..3824d9e 100755 --- a/cts/uninstall.sh +++ b/cts/uninstall.sh @@ -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