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