From 307937febe3bc3ccc5cf975ff7a5c8bdd3df044a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 23 May 2020 21:24:05 +0200 Subject: [PATCH] Stupid hack to avoid the removal of the document server crashing dpkg --- scripts/install | 4 ++++ scripts/remove | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/scripts/install b/scripts/install index 4525689..835f4d0 100644 --- a/scripts/install +++ b/scripts/install @@ -134,6 +134,10 @@ echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set- #================================================= ynh_print_info --message="Install OnlyOffice..." +# The onlyoffice dev had the magnificent idea to add a "nginx restart" during +# the install/configure of their package, which is awful since that will +# restart nginx and the whole webadmin and maybe even the yunohost command +# running the install ... ynh_add_app_dependencies --package="onlyoffice-documentserver" #================================================= diff --git a/scripts/remove b/scripts/remove index 72b5531..6d06f9b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -36,7 +36,16 @@ supervisorctl stop all ynh_print_info --message="Removing OnlyOffice..." ynh_secure_remove --file=/var/lib/dpkg/info/onlyoffice-documentserver.prerm + +# Here you will wonder what the fuck this is, and the answer is : this is a +# fucking stupid hack because onlyoffice's dev deviced to put a "supervisorctl +# update" inside their postrm, but when their postrm is ran, supervisorctl is +# already removed ... so their removal fails which breaks dpkg. +# So instead, we trick it with this stupid link to /bin/true which is removed +# right after. +ln -s /bin/true /usr/local/bin/supervisorctl ynh_package_autopurge onlyoffice-documentserver +ynh_secure_remove /usr/local/bin/supervisorctl #================================================= # REMOVE THE POSTGRESQL DATABASE