From 982c93e3a2355ba211ee996e1d12cac09668a224 Mon Sep 17 00:00:00 2001 From: Michael Wyraz Date: Thu, 21 Nov 2019 13:46:38 +0100 Subject: [PATCH] Print roundcube error log to stdout --- webmails/roundcube/start.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webmails/roundcube/start.py b/webmails/roundcube/start.py index 7851921a..f2c037cb 100755 --- a/webmails/roundcube/start.py +++ b/webmails/roundcube/start.py @@ -4,6 +4,7 @@ import os import logging as log import sys from socrate import conf +import subprocess log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) @@ -35,8 +36,12 @@ else: conf.jinja("/php.ini", os.environ, "/usr/local/etc/php/conf.d/roundcube.ini") # Fix some permissions -os.system("mkdir -p /data/gpg") -os.system("chown -R www-data:www-data /data") +os.system("mkdir -p /data/gpg /var/www/html/logs") +os.system("touch /var/www/html/logs/errors") +os.system("chown -R www-data:www-data /data /var/www/html/logs") + +# Tail roundcube logs +subprocess.Popen(["tail","-f","-n","0","/var/www/html/logs/errors"]) # Run apache os.execv("/usr/local/bin/apache2-foreground", ["apache2-foreground"])