Clean log and autostart on uninstall

This commit is contained in:
Disassembler 2018-10-31 13:56:59 +01:00
parent 20a6d670ca
commit 5919719f3e
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
19 changed files with 5 additions and 18 deletions

View File

@ -122,6 +122,8 @@ class AppMgr:
def uninstall_app(self, item):
# Main uninstallation function. Wrapper for uninstall script, filesystem purge and unregistration
self.stop_app(item)
if tools.is_service_autostarted(item.app):
self.vmmgr.disable_autostart(item.app)
deps = self.get_install_deps(item.app, False)[::-1]
for dep in deps:
if dep not in self.get_uninstall_deps():
@ -155,6 +157,9 @@ class AppMgr:
srv_dir = os.path.join('/srv/', name)
if os.path.exists(srv_dir):
shutil.rmtree(srv_dir)
lxc_log = '/var/log/lxc/{}.log'.format(name)
if os.path.exists(lxc_log):
os.unlink(lxc_log)
def register_package(self, name):
# Registers a package in local configuration

View File

@ -5,7 +5,6 @@ set -ev
rm -f /etc/periodic/hourly/ckan
# Remove service
rc-update del ckan || true
rm -f /etc/init.d/ckan
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del crisiscleanup || true
rm -f /etc/init.d/crisiscleanup
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del cts || true
rm -f /etc/init.d/cts
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del frontlinesms || true
rm -f /etc/init.d/frontlinesms
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del gnuhealth || true
rm -f /etc/init.d/gnuhealth
rc-update -u

View File

@ -5,7 +5,6 @@ set -ev
rm -f /etc/periodic/daily/kanboard
# Remove service
rc-update del kanboard || true
rm -f /etc/init.d/kanboard
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del mifosx || true
rm -f /etc/init.d/mifosx
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del motech || true
rm -f /etc/init.d/motech
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del opendatakit-build || true
rm -f /etc/init.d/opendatakit-build
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del opendatakit || true
rm -f /etc/init.d/opendatakit
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del openmapkit || true
rm -f /etc/init.d/openmapkit
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del pandora || true
rm -f /etc/init.d/pandora
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del sahana-demo || true
rm -f /etc/init.d/sahana-demo
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del sahana || true
rm -f /etc/init.d/sahana
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del sambro || true
rm -f /etc/init.d/sambro
rc-update -u

View File

@ -5,7 +5,6 @@ set -ev
rm -f /etc/periodic/hourly/seeddms
# Remove service
rc-update del seeddms || true
rm -f /etc/init.d/seeddms
rc-update -u

View File

@ -2,7 +2,6 @@
set -ev
# Remove service
rc-update del sigmah || true
rm -f /etc/init.d/sigmah
rc-update -u

View File

@ -5,7 +5,6 @@ set -ev
rm -f /etc/periodic/15min/ushahidi
# Remove service
rc-update del ushahidi || true
rm -f /etc/init.d/ushahidi
rc-update -u