From f96b2afca910bfc688455635ab25a2dd795e657e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sun, 17 Apr 2016 17:03:10 +0200 Subject: [PATCH] [fix] Remove useless `email_legacy` conf_regen hook The file `/etc/yunohost/ervices.yml` is now updated thanks to 0bacf65, allowing to add new services and remove old ones. Moreover, while migrating to new YunoHost version, the user should execute `apt-get autoremove` to remove old packages such as spamassassin, amavis and postgrey. This sounds more reliable and allows to get rid of this useless hook which would be executed for ever, trying to stop already removed services. --- data/hooks/conf_regen-old/22-email-legacy | 43 ----------------------- 1 file changed, 43 deletions(-) delete mode 100644 data/hooks/conf_regen-old/22-email-legacy diff --git a/data/hooks/conf_regen-old/22-email-legacy b/data/hooks/conf_regen-old/22-email-legacy deleted file mode 100644 index 9c58f9349..000000000 --- a/data/hooks/conf_regen-old/22-email-legacy +++ /dev/null @@ -1,43 +0,0 @@ -set -e - -# Execute this hook only if we force the configuration regeneration -if [[ "$1" == "True" ]]; then - - # Add new email services - sudo yunohost service add rspamd -l /var/log/mail.log \ - || echo "rspamd is already listed in services" - - sudo yunohost service add rmilter -l /var/log/mail.log \ - || echo "rmilter is already listed in services" - - sudo yunohost service add redis-server -l /var/log/redis/redis-server.log \ - || echo "redis-server is already listed in services" - - # Remove previous email services - systemctl is-enabled spamassassin > /dev/null 2>&1 \ - && sudo systemctl disable spamassassin - systemctl is-active spamassassin > /dev/null \ - && sudo systemctl stop spamassassin - sudo rm -f /etc/cron.daily/spamassassin - sudo yunohost service status spamassassin > /dev/null 2>&1 \ - && sudo yunohost service remove spamassassin - - # 'systemctl is-enabled' does not work for service with no systemd unit file - sudo ls /etc/rc2.d/S??amavis > /dev/null 2>&1 \ - || sudo systemctl disable amavis - sudo systemctl is-active amavis > /dev/null \ - && sudo systemctl stop amavis - sudo yunohost service status amavis > /dev/null 2>&1 \ - && sudo yunohost service remove amavis - - # 'systemctl is-enabled' does not work for service with no systemd unit file - sudo ls /etc/rc2.d/S??postgrey > /dev/null 2>&1 \ - || sudo systemctl disable postgrey - sudo systemctl is-active postgrey > /dev/null \ - && sudo systemctl stop postgrey - sudo yunohost service status postgrey > /dev/null 2>&1 \ - && sudo yunohost service remove postgrey - -fi - -exit 0