From f73ae4eeab3efb8059c0b1a51bd7acd8ce9ae9c5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 28 Sep 2020 20:00:33 +0200 Subject: [PATCH] c.f. issue 1274, test at the beginning of postinstall that iptables is working instead of miserably crashing at a later stage --- src/yunohost/tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 1c45ef770..a842cc590 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -279,6 +279,9 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False, else: dyndns = False + if os.system("iptables -V >/dev/null 2>/dev/null") != 0: + raise YunohostError("iptables/nftables does not seems to be working on your setup. You may be in a container or your kernel does have the proper modules loaded. Sometimes, rebooting the machine may solve the issue.", raw_msg=True) + operation_logger.start() logger.info(m18n.n('yunohost_installing'))