Try to avoid filesystem errors when removing apps

This commit is contained in:
Bob Mottram 2017-06-12 11:19:43 +01:00
parent c437b22f2c
commit da7380356b
9 changed files with 34 additions and 10 deletions

View File

@ -432,9 +432,12 @@ function remove_etherpad {
remove_completion_param install_etherpad
sed -i '/etherpad/d' $COMPLETION_FILE
remove_backup_database_local etherpad
deluser --remove-all-files etherpad
remove_nodejs etherpad
sync
delgroup etherpad
deluser --remove-all-files etherpad
function_check remove_ddns_domain
remove_ddns_domain $ETHERPAD_DOMAIN_NAME
}

View File

@ -297,7 +297,6 @@ function remove_ghost {
read_config_param "GHOST_DOMAIN_NAME"
nginx_dissite $GHOST_DOMAIN_NAME
remove_certs ${GHOST_DOMAIN_NAME}
deluser --remove-all-files ghost
if [ -f /etc/nginx/sites-available/$GHOST_DOMAIN_NAME ]; then
rm -f /etc/nginx/sites-available/$GHOST_DOMAIN_NAME
fi
@ -312,6 +311,10 @@ function remove_ghost {
sed -i '/Ghost/d' $COMPLETION_FILE
sed -i '/ghost/d' $COMPLETION_FILE
sync
delgroup ghost
deluser --remove-all-files ghost
function_check remove_ddns_domain
remove_ddns_domain $GHOST_DOMAIN_NAME
}

View File

@ -373,8 +373,10 @@ function remove_gogs {
remove_completion_param "install_gogs"
sed -i '/gogs /d' $COMPLETION_FILE
remove_backup_database_local gogs
deluser --remove-all-files gogs
sync
delgroup gogs
deluser --remove-all-files gogs
function_check remove_ddns_domain
remove_ddns_domain $GIT_DOMAIN_NAME

View File

@ -239,6 +239,9 @@ function remove_mailpile {
fi
function_check remove_ddns_domain
remove_ddns_domain $MAILPILE_DOMAIN_NAME
sync
delgroup mailpile
deluser --remove-all-files mailpile
remove_config_param MAILPILE_DOMAIN_NAME

View File

@ -484,8 +484,11 @@ function remove_matrix {
pip uninstall .
rm -rf $MATRIX_DATA_DIR
rm -rf /etc/matrix
deluser --remove-all-files matrix
sync
delgroup matrix
deluser --remove-all-files matrix
remove_onion_service matrix ${MATRIX_ONION_PORT}
remove_onion_service matrix ${MATRIX_FEDERATION_ONION_PORT}

View File

@ -252,8 +252,10 @@ function remove_mediagoblin {
sed -i '/mediagoblin/d' $COMPLETION_FILE
remove_nodejs mediagoblin
deluser --remove-all-files mediagoblin
sync
delgroup mediagoblin
deluser --remove-all-files mediagoblin
function_check remove_ddns_domain
remove_ddns_domain $MEDIAGOBLIN_DOMAIN_NAME

View File

@ -283,8 +283,10 @@ function remove_radicale {
fi
firewall_remove ${RADICALE_PORT} tcp
deluser --remove-all-files radicale
sync
delgroup radicale
deluser --remove-all-files radicale
function_check remove_onion_service
remove_onion_service radicale ${RADICALE_ONION_PORT}

View File

@ -374,8 +374,11 @@ function remove_tahoelafs {
remove_onion_service tahoelafs ${TAHOELAFS_ONION_PORT}
remove_onion_service storage-tahoelafs ${TAHOELAFS_STORAGE_ONION_PORT} $(get_tahoelafs_nick)
sed -i '/HidServAuth /d' /etc/tor/torrc
deluser --remove-all-files tahoelafs
sync
delgroup tahoelafs
deluser --remove-all-files tahoelafs
if [ -d $TAHOE_DIR ]; then
rm -rf $TAHOE_DIR
fi
@ -622,8 +625,9 @@ function install_tahoelafs {
apt-get -yq install python-virtualenv apache2-utils
if [ -d $TAHOE_DIR ]; then
deluser --remove-all-files tahoelafs
sync
delgroup tahoelafs
deluser --remove-all-files tahoelafs
rm -rf $TAHOE_DIR
fi

View File

@ -357,8 +357,6 @@ function remove_turtl {
remove_app turtl
remove_completion_param install_turtl
sed -i '/turtl/d' $COMPLETION_FILE
deluser --remove-all-files turtl
delgroup turtl
nginx_dissite $TURTL_DOMAIN_NAME
if [ -f /etc/nginx/sites-available/$TURTL_DOMAIN_NAME ]; then
rm /etc/nginx/sites-available/$TURTL_DOMAIN_NAME
@ -371,6 +369,10 @@ function remove_turtl {
rm -rf /etc/rethinkdb
rm -rf /var/lib/rethinkdb
rm -rf $TURTL_BASE_DIR
sync
delgroup turtl
deluser --remove-all-files turtl
}