Clean log and autostart on uninstall

This commit is contained in:
Disassembler 2018-10-31 13:56:59 +01:00
parent 20a6d670ca
commit 5919719f3e
Signed by: Disassembler
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): 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) 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] 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():
@ -155,6 +157,9 @@ class AppMgr:
srv_dir = os.path.join('/srv/', name) srv_dir = os.path.join('/srv/', name)
if os.path.exists(srv_dir): if os.path.exists(srv_dir):
shutil.rmtree(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): def register_package(self, name):
# Registers a package in local configuration # Registers a package in local configuration

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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