Stop app before uninstalling
This commit is contained in:
parent
cdb74d9677
commit
b76a350d7b
@ -121,6 +121,7 @@ class AppMgr:
|
|||||||
|
|
||||||
def uninstall_app(self, item):
|
def uninstall_app(self, item):
|
||||||
# Main uninstallation function. Wrapper for uninstall script, filesystem purge and unregistration
|
# Main uninstallation function. Wrapper for uninstall script, filesystem purge and unregistration
|
||||||
|
self.stop_app(item)
|
||||||
deps = self.get_install_deps(item.app, False)[::-1]
|
deps = self.get_install_deps(item.app, False)[::-1]
|
||||||
for dep in deps:
|
for dep in deps:
|
||||||
if dep not in self.get_uninstall_deps():
|
if dep not in self.get_uninstall_deps():
|
||||||
|
@ -8,7 +8,7 @@ rc-update -u
|
|||||||
|
|
||||||
# Drop database and user
|
# Drop database and user
|
||||||
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
|
[ ! -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
|
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user